Why does my WatchKit extension cause a “Waiting to attach” message on an actual Apple Watch but not in a simulator?

后端 未结 6 1057
不知归路
不知归路 2021-01-05 13:01

I have a published iOS app and am trying to add a WatchKit extension for it.

For now, all I have is a watch interface.storyboard with a si

6条回答
  •  北海茫月
    2021-01-05 13:57

    The Waiting to attach message is bothering many people. Here are a few things that you can do:

    • Build the main iPhone app first, then stop it and build the WatchKit app
    • Wait some time for the attachment to finish (it can take 20 seconds or so)
    • I found that tapping the app icon on the Apple Watch sometimes helps to re-establish a lost connection. After tapping the app icon, the app often starts to update. So tap on your Apple Watch app after the message Waiting to attachappears.
    • If waiting does not help, stop all processes (make sure that the stop button in Xcode becomes gray) and then build and run your code again
    • Sometimes, restarting Xcode helps to solve problems
    • Force-quit your app on the Apple Watch as explained here
    • If that still does not help, deinstall and reinstall your WatchKit extension using the Apple Watchapp on your iPhone

    Other things you could try:

    • Clean your project
    • Uninstall and re-install your watch app using the Apple Watchapp on your iPhone
    • Delete your iPhone app from the device
    • Delete/recreate the target scheme
    • In the WatchKit app target settings, set "Skip Install" to NO

提交回复
热议问题