skip to Main Content

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)

2

Answers


  1. Chosen as BEST ANSWER

    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.


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search