
Tip: If you use automatic signing (recommended), Xcode repairs most code signing errors for you.
If an entitlement error occurs at installation or runtime, you should verify the capabilities you added and signing certificate you used while developing the app in Xcode. Then use command-line utilities to verify the signature of the app and examine the provisioning profile that is embedded in the app.
Some entitlements (for example, App Sandbox entitlements) are set in your Xcode project and are applied to the signature. Other entitlements are enabled for an App ID and contained in the provisioning profile. You can check if the signature has the correct entitlements and if discrepancies occur, examine the embedded provisioning profile.
These steps show how to examine a build in Xcode but you can use these same commands on a build you distribute to users. To create a build in Xcode, launch an app on a device. If you don’t have a device, choose the generic device from the scheme menu. For macOS apps, just build and run your app before performing these steps.
First ensure that the capabilities are enabled and entitlements are set for the development provisioning profile.
In the project editor, choose the target from the Project/Targets pop-up menu, then click General.
If necessary, click the disclosure triangle next to the Signing section to reveal the settings.
Next to the provisioning profile name, click the information icon to see the details.
A popover appears containing the contents of the provisioning profile.

In the Capabilities and Entitlements section, verify that the capabilities you want to use are configured.
In the Project navigator (
), open the Products group under the project.
In the Products group, Control-click the build (a file with a .app extension), and choose “Show in Finder” from the shortcut menu.
Xcode opens the Finder to the location of the build location.
Launch Terminal (located in /Applications/Utilities), and enter this text followed by a space character (do not press Return):
codesign -d --entitlements -In the Finder, drag the app binary to Terminal.
Press Return.
For example, the output for an iOS app that is enabled for iCloud Key-Value Storage contains the com.apple.developer.ubiquity-kvstore-identifier entitlement key. The output for a macOS app that is enabled for App Sandbox contains the com.apple.security.app-sandbox entitlement key.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>application-identifier</key> <string>G9B5P7QDV2.edu.self.HelloWorld</string> <key>com.apple.developer.pass-type-identifiers</key> <array> <string>G9B5P7QDV2.*</string> </array> <key>com.apple.developer.ubiquity-container-identifiers</key> <array> <string>G9B5P7QDV2.edu.self.HelloWorld</string> </array> <key>com.apple.developer.ubiquity-kvstore-identifier</key> <string>G9B5P7QDV2.edu.self.HelloWorld</string> <key>get-task-allow</key> <true/></dict></plist>If the signature entitlements are different than what you have configured, verify that the embedded provisioning profile is correct. First, you need to locate the embedded provisioning profile.
In the Project navigator (
), Control-click the build under the Products group, and choose “Show in Finder” from the pop-up menu.
Xcode opens the Finder to the location of the build location.
In the Finder, Control-click the build (a file with a .app extension), and choose Show Package Contents from the pop-up menu.
For iOS apps, a provisioning profile called embedded.mobileprovision appears in the Finder window. For macOS apps, the embedded file is called embedded.provisionprofile.
Alternatively, verify the entitlements in the distribution provisioning profile used when you export an iOS, tvOS, or watchOS app, export a macOS app, or upload an app to App Store Connect.
In the Summary sheet, click the arrow next to the provisioning profile to show it in Finder.

In Terminal, enter this text (do not press Return):
security cms -D -iIn the Finder, drag the provisioning profile in the build to Terminal.
Press Return.
This command outputs a property list in XML format.
Locate the Entitlements key in the output and verify that the application-identifier key has the correct entitlements.
For example, the following listing shows an iOS app that is enabled for data protection, Wallet, and iCloud. iCloud entitlements begin with the text com.apple.developer.ubiquity.
<key>Entitlements</key> <dict> <key>application-identifier</key> <string>G9B5P7QDV2.*</string> <key>com.apple.developer.default-data-protection</key> <string>NSFileProtectionComplete</string> <key>com.apple.developer.pass-type-identifiers</key> <array> <string>G9B5P7QDV2.*</string> </array> <key>com.apple.developer.ubiquity-container-identifiers</key> <array> <string>G9B5P7QDV2.*</string> </array> <key>com.apple.developer.ubiquity-kvstore-identifier</key> <string>G9B5P7QDV2.*</string> <key>get-task-allow</key> <true/> <key>inter-app-audio</key> <true/> <key>keychain-access-groups</key> <array> <string>G9B5P7QDV2.*</string> </array> </dict>To learn more ways to use these commands, read the man pages (in Terminal, enter man codesign and man security respectively).