Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - Error launching WatchKit Extension

I've successfully built a basic Watch/iPhone app and am getting the following error when trying to run on my devices:

"Error Launching 'app_name WatchKit Extension'

The operation couldn’t be completed. Unable to launch because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user."

The app does install to the watch/phone, but I want to use the extension to view console output while running the app.

I am using automatic provisioning, which is not giving any errors. I am not using Apple's paid developer program. Has anybody experienced this before? Cheers.

like image 374
Bryan Avatar asked Mar 18 '19 00:03

Bryan


3 Answers

This setting should be set to Trust(your Apple id) in Settings -> General -> Device Management ->

like image 171
Shoaib Mohammed Avatar answered Oct 27 '22 17:10

Shoaib Mohammed


I resolved this by opening the app on the Apple Watch for the first time, then selecting "Trust developer" on the prompt that appeared.

like image 29
Bryan Avatar answered Oct 27 '22 17:10

Bryan


The workflow seems to be different depending on your usecase:

  1. WatchOS app with iPhone app
  2. Standalone WatchOS app

For usecase 1, I had to trust myself as a developer in the iPhone Settings -> General -> Device Management. Note, you need to try and run the app on your devices before the menu option is available on the iPhone.

For usecase 2, I had to trust myself as a developer at the prompt that was shown when I opened the app on the watch for the first time.

My advice would be to try to get usecase 1 working first, before trying usecase 2. Note, if you have a free developer account you will need to uninstall the usecase 1 app from the iPhone and from the watch before you can install usecase 2, as the free account only supports one app at a time.

I wasted time by starting with usecase 2 and could not get it to work for some reason. After I gave up and did usecase 1, then subsequently tried my usecase 2 app again without changing any XCode settings, it just seemed to work for some unknown reason.

I'm using XCode 11.4, iOS 13.4 and WatchOS 6.2 on iPhone 7 Plus and Apple Watch 2 42mm

like image 8
Jake Collins Avatar answered Oct 27 '22 18:10

Jake Collins