简体   繁体   English

Xcode - 启动 WatchKit 扩展时出错

[英]Xcode - Error launching WatchKit Extension

I've successfully built a basic Watch/iPhone app and am getting the following error when trying to run on my devices:我已经成功构建了一个基本的 Watch/iPhone 应用程序,并在尝试在我的设备上运行时收到以下错误:

"Error Launching 'app_name WatchKit Extension' “启动‘app_name WatchKit 扩展’时出错

The operation couldn't be completed.操作无法完成。 Unable to launch because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user."无法启动,因为它的代码签名无效、权限不足或用户未明确信任其配置文件。”

The app does install to the watch/phone, but I want to use the extension to view console output while running the app.该应用程序确实安装到手表/手机上,但我想在运行应用程序时使用扩展程序查看控制台输出。

I am using automatic provisioning, which is not giving any errors.我正在使用自动配置,它没有给出任何错误。 I am not using Apple's paid developer program.我没有使用 Apple 的付费开发者计划。 Has anybody experienced this before?有没有人经历过这种情况? Cheers.干杯。

此设置应在设置 -> 常规 -> 设备管理 -> 中设置为 Trust(your Apple id)

我通过第一次在 Apple Watch 上打开应用程序解决了这个问题,然后在出现的提示中选择“信任开发者”。

The workflow seems to be different depending on your usecase:根据您的用例,工作流程似乎有所不同:

  1. WatchOS app with iPhone app带有 iPhone 应用程序的 WatchOS 应用程序
  2. Standalone WatchOS app独立的 WatchOS 应用程序

For usecase 1, I had to trust myself as a developer in the iPhone Settings -> General -> Device Management.对于用例 1,我必须相信自己是 iPhone 设置 -> 常规 -> 设备管理中的开发人员。 Note, you need to try and run the app on your devices before the menu option is available on the iPhone.请注意,在 iPhone 上提供菜单选项之前,您需要尝试在设备上运行该应用程序。

For usecase 2, I had to trust myself as a developer at the prompt that was shown when I opened the app on the watch for the first time.对于用例 2,我必须在我第一次在手表上打开应用程序时显示的提示中相信自己是一名开发人员。

My advice would be to try to get usecase 1 working first, before trying usecase 2. Note, if you have a free developer account you will need to uninstall the usecase 1 app from the iPhone and from the watch before you can install usecase 2, as the free account only supports one app at a time.我的建议是先尝试让用例 1 工作,然后再尝试用例 2。请注意,如果您有免费的开发者帐户,则需要先从 iPhone 和手表卸载用例 1 应用程序,然后才能安装用例 2,因为免费帐户一次仅支持一个应用程序。

I wasted time by starting with usecase 2 and could not get it to work for some reason.我从用例 2 开始浪费了时间,但由于某种原因无法让它工作。 After I gave up and did usecase 1, then subsequently tried my usecase 2 app again without changing any XCode settings, it just seemed to work for some unknown reason.在我放弃并执行用例 1 之后,随后再次尝试了我的用例 2 应用程序而不更改任何 XCode 设置,它似乎出于某种未知原因而起作用。

I'm using XCode 11.4, iOS 13.4 and WatchOS 6.2 on iPhone 7 Plus and Apple Watch 2 42mm我在 iPhone 7 Plus 和 Apple Watch 2 42mm 上使用 XCode 11.4、iOS 13.4 和 WatchOS 6.2

我遇到了同样的问题,请尝试在模拟器上运行,然后再在设备上运行,这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 启动Watchkit Extension时出错 - Error in Launching Watchkit Extension 启动“Watchkit扩展”时出错 - SPErrorUnknownMessage - Error launching 'Watchkit extension" - SPErrorUnknownMessage Watchkit应用扩展未启动 - Watchkit app extension not launching 在尝试在实际Apple Watch上构建和运行WatchKit扩展时,如何避免错误“错误启动'AppName'WatchKit扩展”? - How can I avoid the error “Error Launching 'AppName' WatchKit Extension” when trying to build and run a WatchKit Extension on an actual Apple Watch? WatchOS 2:“无法安装Watch App”“错误启动'TestApp WatchKit App Extension'” - WatchOS 2: “Cannot Install Watch App” “Error Launching 'TestApp WatchKit App Extension'” Watchkit 错误:WatchKit 扩展包含多个 WatchKit 应用程序 - Watchkit error: WatchKit Extension contains multiple WatchKit apps iOS WatchKit-启动手表应用“ SPErrorInvalidBundleNoGizmoBinaryMessage”时出错 - iOS WatchKit - Error launching watch app “SPErrorInvalidBundleNoGizmoBinaryMessage” 使用Xcode 8和watchOS3配置WatchKit App扩展 - Profile WatchKit App Extension with Xcode 8 and watchOS3 Watchkit与Watchkit通信#Watchkit扩展 - Watchkit to watchkit communication #Watchkit Extension 错误:WatchKit Extension不包含任何WatchKit应用程序。 - Error: WatchKit Extension doesn't contain any WatchKit apps.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM