Cannot install Watch app

一曲冷凌霜 提交于 2019-12-11 03:37:53

问题


When trying to test a Watch app on the Watch, in XCode I get the following warning

Watch App xcodeproj TARGETED_DEVICE_FAMILY contains a value incompatible with the target type.

Looking at the Device logs, it says:

(Error) WatchKit: validateWatchKitApplicationInfoDictionary, invalid UIDeviceFamily value

What am I missing?


回答1:


Modify Targeted Device Family

  1. Open file PROJECT.xcodeproj in your project folder
  2. Open file project.pbxproj
  3. Replace value of TARGETED_DEVICE_FAMILY: "4" for watchkitextension, "1,4" for watchkitapp
  4. Replace value of "TARGETED_DEVICE_FAMILY[sdk=iphonesimulator*]" = "1,4" for watchkitapp

e.g.




回答2:


Your Watch Extension should have a TARGETED_DEVICE_FAMILY of iPhone whereas the Watch App target should have TARGETED_DEVICE_FAMILY of 1,4 like this:

I had a similar problem on a project that was created with an Xcode beta. I ended up creating a new test project and going through side by side and comparing all the settings.



来源:https://stackoverflow.com/questions/30067864/cannot-install-watch-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!