如何将权利文件添加到 XCode 4.5 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12698506/
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-09-13 15:52:21  来源:igfitidea点击:

How can I add an entitlements file to an XCode 4.5 project?

iosxcodexcode4.5

提问by bodacious

Possible Duplicate:
Ad Hoc Distribution on XCode 4.2.1 - entitlements

可能的重复:
XCode 4.2.1 上的 Ad Hoc 分发 - 权利

I'm using Xcode 4.5 and when I go to File > New > File ... I don't see any option for entitlements files any more. How can I add one? Do I just create a blank plist? If so, what do I need to populate it with for an Ad Hoc release?

我正在使用 Xcode 4.5,当我转到 File > New > File ...时,我看不到任何权利文件选项。我怎样才能添加一个?我只是创建一个空白的 plist 吗?如果是这样,我需要为 Ad Hoc 版本填充什么?

Thanks

谢谢

回答by danimal

In Xcode 4.5 you should do the following to get entitlements created (it's not via File > New > File... any longer):

在 Xcode 4.5 中,您应该执行以下操作来创建权利(不再通过 File > New > File...):

  1. Select your project in the left hand file navigator
  2. Select your target
  3. Click on the "Summary" tab in the configuration area
  4. Scroll to the bottom of the "Summary" section and you'll see an "Entitlements" section (you might need to turn down the disclosure triangle next to Entitlements)
  5. Click the checkbox for "Use Entitlements File" and give it a custom name if you want
  6. Fill in any values you need there (you can edit the plist file manually too).
  1. 在左侧的文件导航器中选择您的项目
  2. 选择你的目标
  3. 点击配置区域的“摘要”选项卡
  4. 滚动到“摘要”部分的底部,您将看到“权利”部分(您可能需要关闭权利旁边的显示三角形)
  5. 单击“使用权利文件”复选框并根据需要为其指定自定义名称
  6. 在那里填写您需要的任何值(您也可以手动编辑 plist 文件)。

Do note, you don't need to do anything special for AdHoc builds with entitlements files any longer.

请注意,您不再需要为具有权利文件的 AdHoc 构建执行任何特殊操作。

回答by Suhail Patel

Entitlements.plistis just a plist file generally with one key value pair (get-task-allow) under root (which is a dictionary, see the image below) so creating a normal plist file is just fine.

Entitlements.plist只是一个 plist 文件,通常get-task-allow在 root 下有一个键值对 ( )(这是一个字典,见下图)所以创建一个普通的 plist 文件就可以了。

Get Task Allow

获取任务允许

Also don't forget to point it to your Entitlements.plist in your target in Build Settings -> Code Signing Entitlements (if Xcode doesn't automatically set it)

另外不要忘记在 Build Settings -> Code Signing Entitlements 中将它指向你的目标中的 Entitlements.plist(如果 Xcode 没有自动设置它)

Build Settings

构建设置

Read more here: http://developer.apple.com/library/ios/#qa/qa1710/_index.html

在此处阅读更多信息:http: //developer.apple.com/library/ios/#qa/qa1710/_index.html

回答by Noah

Go to files > New File > Entitlements file...something like this must be there.

转到文件 > 新建文件 > 权利文件...必须有这样的东西。

Sorry I correct > use the property file as entitlements!

对不起,我更正> 使用属性文件作为权利!