首页 > 解决方案 > 你在 Apple Developer Portal 中看到的 Xcode 的功能和 AppID 功能之间不应该存在 1-1 的关系吗?

问题描述

我正在研究开发门户中的 AppID 功能……</p>

Xcode的能力和AppID能力不应该是1-1的关系吗?如果我尝试添加一项功能,我确实会在 Xcode 中看到钥匙串共享。

但是,我在 AppID 的 Apple 开发人员门户中看不到这种功能。为什么?

标签: xcodeentitlementsapp-idapple-developer

解决方案


感谢Dave Lyon给了我这个答案:

这很混乱!

在开发门户中,您请求特定的权利,但并非所有权利都需要纳入您的个人资料,因此它们不会全部显示。

您在 AppID 的配置文件中看到的每项功能都需要授权。

对于您在 Xcode 中添加的每个功能,情况并非如此。因此,您会在 Xcode 中发现更多功能。其中一些可能需要权利,而另一些可能不需要。

特别是在您的情况下,钥匙串共享不需要权利,因此您在配置 App ID 时看不到它们。

编辑:从 Apple 找到文档

您可以使用 Xcode 目标编辑器的“摘要”选项卡 [我认为现在使用“签名和功能”选项卡完成] 设置许多权利。其他权利需要编辑目标的权利属性列表文件。最后,从用于运行应用程序的 iOS 配置文件继承了一些权利 。

The ☝️ is important and yet cryptic. That's why Apple tells us that the code signing entitlements depends is quite complex and depends on various inputs

Check the Built Binary

The first step in debugging code signing entitlement problems is to check the actual entitlements of the binary. Xcode’s process for setting entitlements is quite complex, and it depends on various inputs, so it’s important to start by checking the output rather than looking at just the inputs.

To check the entitlements in your binary run the following command:

$ codesign -d --entitlements :- NetworkExtensionSample.app

Source: Apple Forums


This page is also worth seeing. It goes through the entitlements process.

https://developer.apple.com/library/archive/technotes/tn2415/_index.html#//apple_ref/doc/uid/DTS40016427-CH1-SOURCES

Has A LOT of good explanations. Make sure you read it inside out.

enter image description here

When a profile is used for code signing, Xcode transfers the profile’s associated entitlements to the resulting code signature of the .app.

During code signing, the entitlements corresponding to the app’s enabled Capabilities/Services are transferred to the app’s signature from the provisioning profile Xcode chose to sign the app.

There’s also two sections under Entitlement Sources and Entitlement Destination

Specifically under the Entitlement Destination:

  • The app’s signature
  • The app’s embedded provisioning profile

This implies the provisioning profiles are embedded but the app can end up having different entitlements. Basically if an entitlement is the kind that needs to be given through Provisioning profiles and your app is using it then you need to have that entitlement in your provisioning profile otherwise it would error upon code-signing.


推荐阅读