9

I am trying to debug my watch app. I build and try to run as usual. It says Build succeeded, installing to watch etc. but then, instead of launching my app, it says Finished running app on watch. I've restarted Xcode, reinstalled my app on watch etc. but no avail.

What am I doing wrong?

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389

4 Answers4

8

I've also restarted my Mac, my iPhone and my Watch. It then worked.

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
3

I restarted everything and it still didn't work. However, after the restart when I first run the app I received an error: Device doesn’t support wireless sync. With this, after disabling the wifi on the watch, things went back to normal.

Radu Vlad
  • 1,474
  • 2
  • 21
  • 37
  • 1
    I didn't get this error, but disabling wifi on the watch worked for me. I believe this forces the connection to the watch to go via the iPhone, rather than Xcode buggily attempting to connect directly to the watch via wifi network. – pjh68 May 13 '20 at 20:33
  • Connecting my Mac to my router's slower* wifi worked for me. (*slower than wired). I got this error using ethernet from Mac to router. After connecting my Mac to the router via the 2.4ghz SSID, it worked. (connecting over the 5ghz SSID did not.) The wifi connection is slower and later than the ethernet, so this is a far from ideal; but the connection to the watch appears to go faster this way than when the watch is not connected to wifi. So I guess I'll connect and disconnect my Mac from the slow network connection depending on if I'm developing for the Apple Watch at the moment… ugh. – timeSmith Jun 17 '20 at 09:15
3

From my experience, restarting all devices (iPhone, watch, and mac) sometimes allows the app to build on the watch, but it is very frustrating and a long process for a "maybe."

Especially when I get the Device doesn't support wireless sync. the most consistent solve has been disabling wifi on both the watch and the iPhone. Also, have the iPhone connected directly to the computer with a genuine cord.

Good luck.

Also, if you were using the simulator, stop it and quit the simulator before trying to compile to the real device.

Mykel
  • 1,355
  • 15
  • 25
  • 2
    Yup, it's a terrible experience and while debugging iPhone is a great and solid experience, debugging watch apps are a complete mess and a sole reason to give up on development for Apple Watch platform. – Can Poyrazoğlu Apr 06 '20 at 09:44
  • 1
    @CanPoyrazoğlu Thanks for the comment. I feel your pain. I definitely agree Apple Watch development has significant room for improvement, but I think over time with hardware improvements it could be very gratifying. Let's keep at it and continue to share knowledge with the community. – Mykel Apr 06 '20 at 18:36
0

You just have to attach the Xcode debugger to the process which is running on the watch!

Xcode -> Debug -> Attach to Process > "name of your app watch extension"

After that Xcode displays "Running ... Extension on Apple Watch" and you can start debugging

Ing. Ron
  • 2,005
  • 2
  • 17
  • 33