I am working on an app for watchOS that is supposed to extend my iOS app's features.
I run my app on the iOS simulator. Then, I select the scheme for the Watch app and the simulator next to it says "iPhone 7 + Apple Watch Series 2 - 38mm". However, when I hit "run", the iOS app gets force closed, the iOS simulator gets stuck and the app launches on the Watch simulator.
Now, I need to navigate back to the iOS scheme again in order to run my app on the iOS simulator. This appears to disconnect the devices so I can't test the functionality of WCSession
which I am trying to implement. I am figuring out the updateApplicationContext
method but in 9/10 times, the Watch doesn't seem to receive any updates. Only after a long session of force closing and alternating "run"s I sometimes get the watch simulator to receive the messages from the iOS app.
Another obstacle caused by the weird "running order" is that I also can't debug the watch app with Xcode's console log output because the iPhone always has to be the last one to "run" so I can't even select the console to "listen" to the watch simulator.
How the heck are you supposed to set this up? This can't be Apple's recommended way of developing an app for watchOS.
I found out that if I click the "stop" icon when the iOS scheme is selected before running the watch app, the iOS simulator at least "survives" and I can open the iOS app afterwards which makes the WCSession
work most of the time. However, I am still not satisfied as there is still so many extra steps every time I want to run everything again.