1

I just got back into iOS / WatchKit development after a ~8 year break. I'm having a really hard time making an app for the watch, because

  • Simulator is not helping because random things seem unsupported (most recent example being WCSession.transferFile, which apparently is a bug)
  • On device is not helping because the loop to get it to run on device is completely out of hand, and I was not able to get either logging or debugging to work when running on device. (My main problem is that if I do CMD R in Xcode with my Watch selected as target, it builds, and says running, but never launches the app. If I launch the app manually I find it's not the most recent version. I have to go and remove it from the watch, and re-add it, which then causes Xcode to not be able to run it anymore, which means I have to restart Xcode. What.)

So my question to more experienced devs is: what's your debug cycle when writing Apple Watch apps?


I'm running Xcode 12, watchOS 7.1, on Mac OS 10.15.7 (not Big Sur which may be some cause of issues)

fabian789
  • 8,348
  • 4
  • 45
  • 91
  • I'm having similar issues with Xcode 12.5, Big Sur 11.2.3. The watch simulator can't connect to the phone simulator at all, even built-in apps like Shortcuts don't work properly with the simulator. With real devices my app works on watch, but I get no debugger support. – Max May 19 '21 at 14:57

2 Answers2

0

Some steps that help for on device debugging:

  1. To re-install the watch app, select the iPhone app in Xcode and build and run that. This will also re-build and re-install the watch app as needed.
  2. Open the app manually on the watch

I still haven't figured out how to get a debugger or console, but for now my hack is to have a label on the watch that I use as my on device console.

fabian789
  • 8,348
  • 4
  • 45
  • 91
0

This is almost certainly an Xcode 12 issue. At least since Xcode 12.5 my app has not worked with watch simulator (it can't connect to the phone simulator) and I get no debugger with a real device.

Using Xcode 12.3 seems to work.

Max
  • 21,123
  • 5
  • 49
  • 71