Debug on Real Apple Watch: Application Verification Failed

Debug on real Apple Watch: Application Verification Failed

It turns out you also have to add the UDID of the Apple Watch to the Apple Developer Portal, and update your Development provisioning profile to include this UDID.

The UDID can be obtained in Devices window of Xcode. After pairing, the info of the Apple Watch will automatically display below the info of your iPhone.

At the time of writing, this seems to be documented nowhere, and the error message on the Apple Watch wasn't particularly helpful. So I wish this try-and-error lesson would save you some hassle.

Debug WatchKit on real Apple Watch - Nothing happens

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:

  1. Make sure, the App on your Watch is not running (as BalestraPatrick described). Launch the app and hold the side button a few seconds to bring up the "Turn off your Watch" dialog. Hold the side button for another few seconds to close the app and to return to the Watch homescreen.
  2. Make sure the iPhone is not locked.

  3. Select the WatchKit App target and your real iPhone and run the project.

  4. Running the Watch App resulted quite often in an error SPErrorInvalidBundleNoGizmoBinaryMessage. Re-starting Xcode and cleaning both the Watch App and the App target solved this.
  5. If the build of the Watch App succeed there will be a short message in Xcode but nothing on your iPhone or Watch. If you have made changes to the Watch App it will take a few seconds to refresh the app on the Watch. This is indicated by the progress-circle overlay over the app icon. If you made no changes ore once the app has been transfered: Launch the watch app manually by tapping the icon. There will be no automatic launch.
  6. In most cases Xcode will recognize the app launch and attach its debugger to it. This will allow to use breakpoints, inspect the code, etc.

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]:

  1. Select function in Watch App that will start the call to the iPhone App
  2. The iPhone App will be launched in background. The delays gives you 5 seconds to attach the debugger.
  3. Choose Debug\Attach To Process\Likely Targes\Your iPhone Appin Xcode to attach the debugger.
  4. After the 5 seconds delay the process will continue and you will be able to use breakpoints in your iPhone app code as well.
  5. Do not forget do remove the delay code when you finished testing :-)

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

Is it possible to run WatchKit app on Actual Apple Watch device?

1) Run the iOS app on the iPhone from Xcode

2) The iPhone app will be launch and watch app will be installed on the watch.

3) need to tap the watch app to launch it.

4) When I select Debug -> Attach to process

you can simply type the full and complete name of your process. if you don't know it, try ps -axww in terminal and try to find the process running there and paste the name into Xcode.

Failed to verify code signature WatchKit

I've deleted all watchkit target (extension & app), and create new one, it works now...

EDIT

I've found that it was one of my run script (I don't know which one) that cause the issue.
These scripts where on Apple Watch extension target. Now my scripts stay on the main app's target !

WatchKit App Rejected for Failing to Install

Have you ever opened the project in Xcode 6.3? If so, it likely set your deployment target to iOS 8.3, which will cause this error.



Related Topics



Leave a reply



Submit