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
How to create Entitlement.plist file in Xcode?
提问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.plist
file 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.plist
or the Info.plist
file.
那里的任何更改都会自动更新Entitlements.plist
或Info.plist
文件。
That being said, an Entitlements.plist
file is in the end just a plist
. You can add as much plist
s 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.plist
file 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:
如果您仍想手动创建一个,方法如下:
- File menu > New File...
- Select iOS > Resource > Property List
- Name the new file "
foo.entitlements
" (typically, "foo
" is the target name) - 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)
- 文件菜单 > 新建文件...
- 选择 iOS > 资源 > 属性列表
- 将新文件命名为“
foo.entitlements
”(通常,“foo
”是目标名称) - 单击“权利文件”旁边的 (+) 以添加顶级项目(由于文件扩展名,属性列表编辑器将使用正确的架构)
Don't forget to set your target's CODE_SIGN_ENTITLEMENTS
build 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 中向现有项目添加授权,请按照以下步骤操作:
- Select your project in the Navigator area.
- Select your Target in the Editor area.
- In the Editor area select the Capabilities option from the menu bar.
- Open the disclosure button to the left of the Keychain Sharing option.
- Under Keychain Sharing select the "+" button.
- Type the entitlement in the input area.
- DONE.
- 在导航器区域中选择您的项目。
- 在编辑器区域中选择您的目标。
- 在编辑器区域中,从菜单栏中选择功能选项。
- 打开钥匙串共享选项左侧的披露按钮。
- 在钥匙串共享下,选择“+”按钮。
- 在输入区域中输入权利。
- 完毕。
回答by pkamb
You can manually create an Entitlements.plist
file 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>