问题
As soon as I check "Use Entitlements File"
in Xcode, I get the following error when I try to run my app on my phone:
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements
file do not match those specified in your provisioning profile.
I'm trying to get iCloud working, and it seems like I'm failing on step 1. I can run in the emulator, but not in the device I provisioned automatically through the organizer.
What am I doing incorrectly here?
回答1:
First of all, you need to have specific provisioning for your App's ID, matching its bundle ID. Even if it's only for development, generic Team Provisioning cannot work to test iCloud.
If the App ID had been issued without iCloud enabled, and updated afterward, related Provisioning must be updated also.
Often, provisioning updating from Xcode's organizer fails to bring the right one. In this case, I suggest you to try to download updated provisioning directly from iOS Developer Website.
回答2:
In my case, I have added inter-app capability in my iOS project and Xcode automatically suggested to add this permission in the app id (bundle id) in the provisioning portal and I did so. After this I thought it was fixed since Xcode was showing tick marks for all under inter-app audio sections as follows
- Add the "Inter-App-Audio" entitlement to your APP ID
- Add the "Inter-App-Audio" entitlement to your entitlements file
- Link AudioToolbox.framework.
Actually it was not fixed and I had to generate another distribution certificate with inter-app enabled and only when I signed with that distribution certificate I was able to install the app.
回答3:
You Need to have Developer Certificate And Private Key in your keychain And Provision profile that have created must match with this Certificate.
来源:https://stackoverflow.com/questions/12770298/setting-an-entitlements-file-the-executable-was-signed-with-invalid-entitlemen