在 XCode 中对“调试”或“发布”进行代码签名有什么意义?

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

What is the point of Code signing "Debug" or "Release" in XCode?

iosxcodesecurity

提问by mskw

CodeSigning

代码签名

Referring to the picture, I'm not understanding what is the point having an option to sign the "Debug" or "release" if it is useless as I have try to research. The only thing we are suppose to sign is the "Any iOS SDK". I've also did a binary diff to check that signing Debug and Release creates no difference in the _CodeSignature/CodeResources file.

参考图片,我不明白如果我试图研究它是无用的,那么可以选择签署“调试”或“发布”有什么意义。我们唯一需要签名的是“Any iOS SDK”。我还做了一个二进制差异来检查签名 Debug 和 Release 在 _CodeSignature/CodeResources 文件中没有产生任何差异。

Anyone?

任何人?

回答by Mike Weller

To run any app on the device, it needs to be signed by an authorized developer and contain a valid provisioning profile (signed by Apple) granting permission to run on a device.

要在设备上运行任何应用程序,它需要由授权开发人员签名并包含授予在设备上运行权限的有效配置文件(由 Apple 签名)。

In order to attach a debugger to your app (or use Instruments) the provisioning profile needs to contain entitlements that allow this.

为了将调试器附加到您的应用程序(或使用 Instruments),配置文件需要包含允许这样做的权利。

The "Development" provisioning profiles and certificates which you generate in the portal allow you to do this debugging, whereas the release profiles (for the app store) disable it. This is why you have both "Release" and "Debug" configurations for a project, each with different provisioning profile / identity pairs selected.

您在门户中生成的“开发”配置文件和证书允许您执行此调试,而发布配置文件(针对应用程序商店)禁用它。这就是为什么您有一个项目的“发布”和“调试”配置,每个配置都选择了不同的配置文件/身份对。

The "Any iOS SDK" part is just a way to further change a build setting based on the compilation environment. For example, you may wish to change a compiler setting when running on the Simulator (to disable/enable certain test features).

“Any iOS SDK”部分只是一种根据编译环境进一步更改构建设置的方法。例如,您可能希望在模拟器上运行时更改编译器设置(以禁用/启用某些测试功能)。

Technically this "Any iOS SDK" part isn't required for the signing identity, and none of the other build settings have this extra field by default when you create an iOS project. You may even be able to delete it, but I'm not sure if Xcode will behave.

从技术上讲,签名标识不需要此“任何 iOS SDK”部分,并且在您创建 iOS 项目时,默认情况下其他构建设置都没有此额外字段。您甚至可以删除它,但我不确定 Xcode 是否会起作用。