Unable to install a provisioning profile on an iPhone 14

I got a nice new iPhone to do some debugging on and I'm trying to run my application from Xcode on the new phone. When I run the application it fails and in the "Details" of the failure it tells me that the provisioning profile is invalid:

"A valid provisioning profile for this executable was not found"

Using "Automatically Manage Signing" and choosing my development team, when I click on the little (i) button next to "Xcode managed Profile" I see all check marks. Xcode seems to think I have everything I need. I do see my device listed in the supported devices area.

I have turned "Automatically Manage Signing" off and on (to regenerate the profile) and I've tried manually copying the profile to the phone (emailing it to myself, and using AirDrop). The phone complains that the profile is invalid.

Kicking it old school, I went to my account and created a new development signing certificate, and a provisioning profile that includes my device. I tried using Xcode with the manual certificate and profile and got the same result.

All in all it looks like my phone refuses to accept a provisioning profile. Is there anything more I can try to allow me to use my device for debugging.

(I have tried using Xcode 14 and 14.1b5, and while my phone is running both 16.1b4 and 16.1b5).

Accepted Reply

I eventually figured out what was happening.

After re-reading the provisioning profile tech note, my eye caught on the paragraph which says that previously the user would install a provisioning profile accessible through the Settings on the phone, but modern iOS applications should have their provisioning profiles inside the app bundle in a file called "embedded.mobileprovision".

In iOS 16.1, in the settings, I see provisioning profiles for things like Apple's beta software, but haven't gotten iOS 16.1 to install a new application profile. Perhaps that functionality has been removed? YMMV.

At any rate, being thoroughly modern (ha!) my application, when built, should contain an "embedded.mobileprovision" file. But upon digging in the DerivedData folder and looking in the app package - it didn't. Odd.

I looked at the build transcript and clearly saw a step that was supposed to put that file into the bundle.

So then I looked at our build phases. To make a long story even longer, our application has a history that includes Ionic/Angular and Cordova. There was a script that copies the Ionic/Angular html files into the app bundle. I speculate that you use the Cordova build process then it will build the application using Xcode, then delete the signing that Xcode has done, copy the www folder into the bundle, then re-sign the result.

Since we don't use the whole Cordova build process, the script was copying in the www files, then deleting the code signing, including the embedded.mobileprovision file... but need replacing it.

I deleted the Cordova script, used a Copy Files build phase to get the HTML into the bundle, and let Xcode code sign the application.

  • Wow, that's a tangle web. I'm glad you got it sorted. Thanks for sharing.

Add a Comment

Replies

Did you turn on Developer Mode?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yes. I have. When I looked at the device in the devices and simulators window it had a helpful yellow banner asking me to do that. I did it before all the things I tried above. (I did double-check though. Thank you for the suggestion)

I also used the information in the tech note to look at the content of the provisioning profiles and I double-checked that the device showed up in the list.

One thought I had was all the App ID's I've been using are wildcard IDs. I thought I might try using an explicit ID.

I also need to try another device but I've been out-of-town and haven't had the opportunity yet.

Yes. I have.

Cool.

After doing that, did you disconnect and reconnect the device?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I have disconnected and reconnected the device many times.

I got back home and, unfortunately, I get the same results if I try to use an iPad (10.5 inch iPad Pro MPME2LL/A) so it maybe its something local to my setup.

I tried uninstalling Xcode and reinstalling it and that didn't change anything.

It's not just that Xcode thinks it can't install the profiles. If I email them myself on the devices and try to install them, that fails too. So the profiles are generated in a way that my devices don't like them.

Is there a (publicly accessible) way to collect more information about why a profile was rejected other than just that it was rejected? (I will re-read the tech note so if the answer is in there consider that prior sentence to be rhetorical :-D)

  • Could you solve the issue? I have the same problem.

Add a Comment

I’m out of ideas here )-: I recommend that you open a DTS tech support incident and talk to DTS’s iOS code signing specialist.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I had exactly the same problem and from yesterday on it works. Meanwhile I tried to distribute the app via testflight. When I did it I got an error message, that some Icon`s are missing. I created a new set and from that point on I could also build and install my app via Xcode directly. Eventually that helps you too.

You are kind to have shared your expertise. I will continue to chase the issue down. Thank you!

I eventually figured out what was happening.

After re-reading the provisioning profile tech note, my eye caught on the paragraph which says that previously the user would install a provisioning profile accessible through the Settings on the phone, but modern iOS applications should have their provisioning profiles inside the app bundle in a file called "embedded.mobileprovision".

In iOS 16.1, in the settings, I see provisioning profiles for things like Apple's beta software, but haven't gotten iOS 16.1 to install a new application profile. Perhaps that functionality has been removed? YMMV.

At any rate, being thoroughly modern (ha!) my application, when built, should contain an "embedded.mobileprovision" file. But upon digging in the DerivedData folder and looking in the app package - it didn't. Odd.

I looked at the build transcript and clearly saw a step that was supposed to put that file into the bundle.

So then I looked at our build phases. To make a long story even longer, our application has a history that includes Ionic/Angular and Cordova. There was a script that copies the Ionic/Angular html files into the app bundle. I speculate that you use the Cordova build process then it will build the application using Xcode, then delete the signing that Xcode has done, copy the www folder into the bundle, then re-sign the result.

Since we don't use the whole Cordova build process, the script was copying in the www files, then deleting the code signing, including the embedded.mobileprovision file... but need replacing it.

I deleted the Cordova script, used a Copy Files build phase to get the HTML into the bundle, and let Xcode code sign the application.

  • Wow, that's a tangle web. I'm glad you got it sorted. Thanks for sharing.

Add a Comment

The same problem here, and i double check the device in window - device and simulates - right click the device - show provisioning profile , and i cant find the current profile. Then i tried to add the bottom button + , choose the profile, it show me an error : "Failed to install one or more provisioning profiles on the device. Please ensure the provisioning profile is configured for this device. If not, please try to generate a new profile."

Post not yet marked as solved Up vote reply of wxy Down vote reply of wxy
  • My xcode version 14.3 and macos 13.3

Add a Comment