How to create Entitlement.plist file in Xcode?

前端 未结 4 676
小鲜肉
小鲜肉 2020-12-05 10:31

I have downloaded the latest version of Xcode. I want to create Entitlement.plist file in my project.

Please give me proper steps to create an Entitlement.plis

相关标签:
4条回答
  • 2020-12-05 11:17

    In Xcode 5, for common entitlements you no longer need to create an Entitlements.plist file manually. You use the new Capabilities pane instead. See https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html

    If you still want to create one manually, here's how:

    1. File menu > New File...
    2. Select iOS > Resource > Property List
    3. Name the new file "foo.entitlements" (typically, "foo" is the target name)
    4. Click the (+) next to "Entitlements File" to add a top-level item (the property list editor will use the correct schema due to the file extension)

    Don't forget to set your target's CODE_SIGN_ENTITLEMENTS build setting to be the path to entitlements file you just added.

    0 讨论(0)
  • 2020-12-05 11:20

    You can managed Entitlements in the Capabilities tab of your target settings.

    Any change there will automatically update either the Entitlements.plist or the Info.plist file.

    That being said, an Entitlements.plist file is in the end just a plist. You can add as much plists as you like following the steps provided in this question.

    0 讨论(0)
  • 2020-12-05 11:29

    If you want to add an Entitlement to an existing project in Xcode 5 follow these steps:

    1. Select your project in the Navigator area.
    2. Select your Target in the Editor area.
    3. In the Editor area select the Capabilities option from the menu bar.
    4. Open the disclosure button to the left of the Keychain Sharing option.
    5. Under Keychain Sharing select the "+" button.
    6. Type the entitlement in the input area.
    7. DONE.
    0 讨论(0)
  • 2020-12-05 11:33

    You can manually create an Entitlements.plist file using the template below.

    Save it as YourTargetName.entitlements

    In your Target > Build Settings, set the key "Code Signing Entitlements" (CODE_SIGN_ENTITLEMENTS) to the file's path.

    <?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>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
        <key>beta-reports-active</key>
        <true/>
    </dict>
    </plist>
    
    0 讨论(0)
提交回复
热议问题