ios 如何在 Xcode 中创建 Entitlement.plist 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19674514/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 02:40:04  来源:igfitidea点击:

How to create Entitlement.plist file in Xcode?

iosxcode5

提问by Dinesh Kaushik

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

我已经下载了最新版本的 Xcode。我想在我的项目中创建 Entitlement.plist 文件。

Please give me proper steps to create an Entitlement.plistfile in Xcode.

请给我Entitlement.plist在 Xcode 中创建文件的正确步骤。

回答by Gabriele Petronella

You can managed Entitlements in the Capabilitiestab of your target settings.

您可以在目标设置的功能选项卡中管理权利。

Any change there will automatically update either the Entitlements.plistor the Info.plistfile.

那里的任何更改都会自动更新Entitlements.plistInfo.plist文件。

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

话虽如此,Entitlements.plist文件最终只是一个plist. 您可以按照此问题中plist提供的步骤添加任意数量的s 。

回答by jrc

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

在 Xcode 5 中,对于常见的权利,您不再需要Entitlements.plist手动创建文件。您可以改用新的功能窗格。请参阅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)
  1. 文件菜单 > 新建文件...
  2. 选择 iOS > 资源 > 属性列表
  3. 将新文件命名为“ foo.entitlements”(通常,“ foo”是目标名称)
  4. 单击“权利文件”旁边的 (+) 以添加顶级项目(由于文件扩展名,属性列表编辑器将使用正确的架构)

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

不要忘记将目标的CODE_SIGN_ENTITLEMENTS构建设置设置为您刚刚添加的权利文件的路径。

回答by duncwa

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

如果您想在 Xcode 5 中向现有项目添加授权,请按照以下步骤操作:

  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.
  1. 在导航器区域中选择您的项目。
  2. 在编辑器区域中选择您的目标。
  3. 在编辑器区域中,从菜单栏中选择功能选项。
  4. 打开钥匙串共享选项左侧的披露按钮。
  5. 在钥匙串共享下,选择“+”按钮。
  6. 在输入区域中输入权利。
  7. 完毕。

回答by pkamb

You can manually create an Entitlements.plistfile using the template below.

您可以Entitlements.plist使用以下模板手动创建文件。

Save it as YourTargetName.entitlements

将其另存为 YourTargetName.entitlements

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

在您的 中Target > Build Settings,将密钥“代码签名权利”( CODE_SIGN_ENTITLEMENTS) 设置为文件路径。

<?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>