ios Xcode 8 无法在设备上运行,提及 Apple Watch 的配置文件问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39426287/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 8 cannot run on device, provisioning profile problems mentioning Apple Watch
提问by Sajjon
I am running OS X El Capitan and using the Xcode 8 GM seed (8A218a) and I am trying to run my app on my iPhone 6 with iOS 10 GM seed, 10.01 (14A403), which is paired to my Apple Watch running watchOS 3 GM seed (14S326).
我正在运行 OS X El Capitan 并使用 Xcode 8 GM 种子 (8A218a),我正在尝试在我的 iPhone 6 上使用 iOS 10 GM 种子 10.01 (14A403) 运行我的应用程序,它与运行 watchOS 3 的 Apple Watch 配对转基因种子 (14S326)。
I am using Match for handling provisioning profiles and certificates, it has been working beautifully so far.
我正在使用 Match 来处理配置文件和证书,到目前为止它运行良好。
I recently changed the bundle identifier, so created a new App Id in member center and reconfigured match etc. I have the development certificate and provisioning profile installed on my Mac. I have deleted the old certificates and the old provisioning profiles.
我最近更改了包标识符,因此在会员中心创建了一个新的 App Id 并重新配置了匹配等。我在我的 Mac 上安装了开发证书和配置文件。我已删除旧证书和旧配置文件。
Everything is just working fine running on the simulator. But when I try to run it on my iPhone Xcode 8 is displaying on error:
在模拟器上运行一切正常。但是当我尝试在我的 iPhone 上运行它时,Xcode 8 显示错误:
Provisioning profile "match Development com.XXX.YYY" doesn't include the currently selected device "ZZZ's Apple?Watch".
配置文件“match Development com.XXX.YYY”不包括当前选择的设备“ZZZ's Apple?Watch”。
It shows another error as well:
它也显示了另一个错误:
Code signing is required for product type 'Application' in SDK 'iOS 10.0'
SDK“iOS 10.0”中的产品类型“应用程序”需要代码签名
This is under Target -> General:
Target -> Build Settingslooks like this:
I don't have an Apple Watch extension for this app. So why is Xcode 8 giving me errors relating to my Apple Watch?
我没有此应用程序的 Apple Watch 扩展程序。那么为什么 Xcode 8 会出现与我的 Apple Watch 相关的错误呢?
Also what does the second error mean? Code signing is required for product type 'Application' in SDK 'iOS 10.0'?
还有第二个错误是什么意思?SDK“iOS 10.0”中的产品类型“应用程序”需要代码签名吗?
Thanks!!
谢谢!!
采纳答案by Seltsam
I had the same issue today - XCode Version 8.0 (8A218a) - and fixed it with two simple steps (instead of the more complicated approach above:
我今天遇到了同样的问题 - XCode 版本 8.0 (8A218a) - 并通过两个简单的步骤修复了它(而不是上面更复杂的方法:
- add the Apple Watch to member center (did not find a copy&paste option either)
- edit the development provisioning profile and add the watch to devices, save
- go to XCode prefs, move the old provisioning profile to trash (right click on the name) and download the new version
- set the new provisioning profile in project editor
- 将 Apple Watch 添加到会员中心(也没有找到复制粘贴选项)
- 编辑开发配置文件并将手表添加到设备,保存
- 转到 XCode 首选项,将旧的配置文件移至垃圾箱(右键单击名称)并下载新版本
- 在项目编辑器中设置新的配置文件
No restart, clean or anything else needed. Worked like a charm.
无需重新启动、清理或其他任何需要。像魅力一样工作。
回答by Felix
This did work for me:
这对我有用:
- Disable bluetooth on the iPhone
- Disconnect & reconnect iPhone
- Build and Run
- Enable bluetooth again when you are finished with the debugging session
- 在 iPhone 上禁用蓝牙
- 断开并重新连接 iPhone
- 构建和运行
- 完成调试会话后再次启用蓝牙
回答by Phil Loden
After putting my Apple Watch on Power Reserve (or turning it off, or Airplane mode, or...) and waiting a bit for Xcode to realize it was gone, I was able to run the app on my phone again.
在将我的 Apple Watch 置于 Power Reserve(或将其关闭,或飞行模式,或...)并等待 Xcode 意识到它已消失后,我能够再次在我的手机上运行该应用程序。
Airplane mode is easiest.
飞行模式最简单。
回答by jayjunck
I have the same issue with Version 8.0 (8A218a). It seems to go away when I:
我对版本 8.0 (8A218a) 有同样的问题。当我:
- Reselect the certificate (via UI)
- Clean all (ctrl+cmd+shift+k)
- Restart Xcode
- Run the projet (which is possible after 1-3)
- 重新选择证书(通过 UI)
- 全部清除(ctrl+cmd+shift+k)
- 重启Xcode
- 运行项目(可以在 1-3 之后)
If I change the code, I get the same error again. Do not be fooled by Xcode actually indicating that everything is ok in the UI - but still gives the error. Its 1-4 again.
如果我更改代码,我会再次收到相同的错误。不要被 Xcode 所愚弄,实际上它表明 UI 中的一切正常 - 但仍然给出错误。又是 1-4。
Regarding the 2. error. Looking at your screenshot I see no matching "Signing certificate" - which the message indicates is required. The above 1-4 also removed that error for me.
关于2.错误。查看您的屏幕截图,我看到没有匹配的“签名证书” - 消息表明这是必需的。上面的 1-4 也为我消除了那个错误。
I really do hope there is a better solution to this issue and that we are missing something obvious! The restart-run cycle is not that efficient ;-)
我真的希望有一个更好的解决方案来解决这个问题,并且我们遗漏了一些明显的东西!重启-运行周期效率不高;-)
回答by Lukas Bimba
I was getting the same errors, what happened was iTunes/Apple updated the provisioning profile and I had to accept the new update. Once I logged into "developer.apple.com" I just had to accept the new update and then go back to Xcode, close the project, reopen, and then download the provisioning profile to my new iPhone and then run the project. This is what worked for me.
我遇到了同样的错误,发生的事情是 iTunes/Apple 更新了配置文件,我不得不接受新的更新。登录“developer.apple.com”后,我只需要接受新更新,然后返回 Xcode,关闭项目,重新打开,然后将配置文件下载到我的新 iPhone,然后运行该项目。这对我有用。
I didn't have to delete anything or what the other answers are suggesting.
我不必删除任何内容或其他答案的建议。
回答by John Lee
Xcode 8:
代码 8:
select the target -> General -> Signing -> select Automatically manage signing
选择目标 -> 常规 -> 签名 -> 选择自动管理签名
then Xcode will help you to fix this.
那么 Xcode 会帮你解决这个问题。