Entitlements are not valid

后端 未结 17 2432
野的像风
野的像风 2020-12-01 00:47

Recently, I have upgraded my iPhone SDK OS from version 2.2.1 to 3.0 version. After that, while building my application, I get an error that the provisioning profile has exp

17条回答
  •  执念已碎
    2020-12-01 01:41

    An Entitlements.plist file is required for testers to install ad-hoc builds. The default iOS templates don't include one. In XCode 3.2.4 you create one like this:

    1. From the menu, choose "File > New File…"
    2. Under iOS Templates, there's a Code Signing section. Choose the certificate icon named Entitlements. Name the file "Entitlements.plist"
    3. Select Entitlements.plist in your source tree.
    4. Choose "View > Property List Type > iPhone Entitlements Plist"
    5. Add a new key to the property list (select the top line, press return)
    6. The item will probably be named "Can be debugged". If not, choose that from the available options. This is equivalent to "get-task-allow".

    If you don't yet have one, create an 'ad-hoc' build profile:

    1. Select your target in the source tree.
    2. From the menu, choose "File > Get Info"
    3. In the inspector. select the "Build" tab.
    4. Under 'Configuration', choose "Edit Configurations…'
    5. Select your 'Release' configuration, click 'Duplicate' at the bottom of the screen.
    6. Rename the new configuration "Ad-Hoc Distribution"

    Now you've created an Entitlements.plist, you need to add it to your build settings.

    1. Select your target in the source tree.
    2. From the menu, choose "File > Get Info"
    3. In the inspector. select the "Build" tab.
    4. Make sure the configuration selector is set to "Ad-Hoc Distribution"
    5. In the "Code Signing" group, change the value of "Code Signing Entitlements" to "Entitlements.plist" - XCode may have put in a relative path for you. If so, change it.

    Note - you'll have errors installing the app on your own device if you build & run with "Code Signing Entitlements" set for other build configurations.

    Finally, check that the Entitlements.plist has been added to your target.

    1. Select Entitlements.plist in the source tree.
    2. From the menu, choose "File > Get Info".
    3. Select the "Targets" tab.
    4. Make sure the checkbox next to your target is checked.

    You should now be able to distribute your ad-hoc builds without this error.

    Most of this was gleaned from Apple's Managing Application Entitlements Guide, the rest by trial & error.

提交回复
热议问题