关于iOS XCode的entitlements文件

entitlements,全称 code signing entitlements
苹果官方的说明:https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AboutEntitlements.html

Entitlements confer specific capabilities or security permissions to your iOS or macOS app.

翻译一下就是

授权赋予iOS或macOS应用特定的功能或安全权限。

XCodeCapabilities选项卡下选择一些选项之后,XCode就会生成这样一段 XMLXCode会自动生成一个.entitlements文件,然后在需要的时候往里面添加条目。

在这里插入图片描述


XCode会将这个文件作为 --entitlements参数的内容传给codesign

<?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>keychain-access-groups</key>
        <array>
			<string>$(AppIdentifierPrefix).com.linxinfa.game</string>
		</array>
		<!--推送功能-->
        <key>aps-environment</key>
        <string>development</string>
</dict>
</plist>

这些授权信息必须都在开发者中心的 App ID中启用,并且包含在配置文件中。在构建应用时需要使用的授权文件可以在 XCode工程的Build Settings中的 Code Signing Entitlements中设置。

在这里插入图片描述

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...