Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 single label just to verify the entire building process. The app runs fine on the simulator (iPhone 6 (8.3)) and the Watch simulator.

When I run it on the iPhone and Apple Watch, it runs on the iPhone, installs on the Apple Watch, but then just displays a wait status when trying to run it on the Apple Watch.

The error in Xcode says "Waiting to attach", and when I try to attach it via Xcode > Debug > Attach to Process, it says "Lost connection to iPhone".

I am using Xcode 6.3.1.

like image 231
kzia Avatar asked May 12 '15 02:05

kzia


People also ask

What is a WatchKit extension?

The WatchKit framework provides infrastructure for creating watchOS apps, including an extension delegate that manages background tasks, extended runtime sessions, and Siri intents. The framework also performs other support tasks, such as accessing information about the user's Apple Watch.


1 Answers

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
like image 133
vomako Avatar answered Sep 22 '22 01:09

vomako