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?

廉价感情. 提交于 2019-12-22 05:38:09

问题


When I try to build and run a WatchKit extension on my real Apple Watch, I sometimes get the following error message:

I've tried to build the parent application for the iPhone and then again for my WatchKit app but I still get the error message.

Does anyone know what causes this error message and how to deal with it?


回答1:


This seems to happen when it takes a long time to install the WatchKit App on the actual watch and Xcode times out waiting for the process to start due to the long install time. It can take a long time for two reasons:

  1. It sometimes takes a while for the Watch to "notice" the App needs updating before it begins the transfer.
  2. If your Apple Watch app has a lot of images or other content it needs to transfer to the watch, the actual transfer over Bluetooth can take a long time.

If you want to avoid this error, here are some tips, adapting from this blog post, which can also show you how to speed up your app installs: http://www.sneakycrab.com/blog/2015/5/28/speeding-up-slow-install-times-when-debugging-on-a-real-apple-watch

  1. Choose the iOS base scheme in Xcode to build and install on your phone. (Not the WatchKit App Extension)
  2. Hit stop in Xcode.
  3. Get iOS to notice it needs to begin installing the Watch app. There are two ways, either a) open the page for your app in the Apple Watch Companion App on your phone, or b) tapping on your app directly on the Watch (when you see the spinner, you can hit the crown to go back to the app icon screen, and you should see it start to load)
  4. Once the app is installed on your watch, switch to the WatchKit Extension scheme and hit play, it will be waiting to attach debugging
  5. Launch your app manually.



回答2:


Make sure your iPhone bluetooth is turned on

Then I removed the app from my iPhone and re-launched it. That fixed it for me.



来源:https://stackoverflow.com/questions/30260222/how-can-i-avoid-the-error-error-launching-appname-watchkit-extension-when-tr

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