I am struggling with debugging my WatchKit Extension/App on a real Apple Watch. Debugging both the iPhone App and the WatchKit Extension using the simulator the simulator is
thank you for your answers. I finally managed to get the debugging running (most of the time) on my real Apple Watch. However it is quite cumbersome and not very reliable. There is not enough space in the comments so I will use this answer to describe my solution. Maybe it is help full to other:
Make sure the iPhone is not locked.
Select the WatchKit App
target and your real iPhone and run the project.
SPErrorInvalidBundleNoGizmoBinaryMessage
. Re-starting Xcode and cleaning both the Watch App and the App target solved this.In my case I whanted to inspect how the iPhone App handles the application:handleWatchKitExtensionRequest:reply:
call when the app was not active before. This is important because this cannot be done using the simulator. If the app takes to long to handle the request the Watch will receive no valid response.
After following the steps described above Xcode is only attached the watch app and will not hold on breakpoints in the iPhone app code. To do this, one has to manually attach the Debugger to the iPhone app process that is started when the watch app sends its call.
To be able to attach the debugger I added a delay to the apps main function: [NSThread sleepForTimeInterval:5]
:
Debug\Attach To Process\Likely Targes\Your iPhone App
in Xcode to attach the debugger.NOTE:
You will not be able to see NSLog
output (or any console output at all) from the iPhone App since attaching the debugger does NOT re-route the console output.
Happy testing with this awesome new Apple product :-P