xcode CODE_SIGN_IDENTITY[sdk=iphoneos*] 是什么意思

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

What does CODE_SIGN_IDENTITY[sdk=iphoneos*] mean

iphonexcodesdkxcode4

提问by hol

I am puzzled that there are two entries to enter for the code sign identity. Am not sure whether this was the same in Xcode 3 but in Xcode 4 I see (in the Build Settings) something like this:

我很困惑,代码符号标识有两个条目要输入。我不确定这在 Xcode 3 中是否相同,但在 Xcode 4 中我看到(在构建设置中)是这样的:

Config

配置

In the project.pbxproj for "Distribution" it looks like this

在“分发”的 project.pbxproj 中,它看起来像这样

            CODE_SIGN_IDENTITY = "iPhone Distribution";
            "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";

I cannot find anywhere any documentation what the difference is, but maybe I am overlooking it (in the documentation). I am confused about which one to set and now I set both. But I do not like the "I don't know what I am doing but I it works" feeling. It seems to me like the first one (CODE_SIGN_IDENTITY) is not needed for iPhone development. Because for "Debug" and "Release" I have not changed the value since I migrated from Xcode 3 to Xcode 4 and in project.pbxproj I can see only "CODE_SIGN_IDENTITY[sdk=iphoneos*]" is present.

我在任何地方都找不到任何文档有什么区别,但也许我忽略了它(在文档中)。我对设置哪一个感到困惑,现在我设置了两个。但我不喜欢“我不知道我在做什么,但我很有效”的感觉。在我看来,iPhone 开发不需要第一个 (CODE_SIGN_IDENTITY)。因为对于“调试”和“发布”,自从我从 Xcode 3 迁移到 Xcode 4 和在 project.pbxproj 中,我没有更改值,我只能看到“CODE_SIGN_IDENTITY[sdk=iphoneos*]”存在。

So back to my question does anyone know what "CODE_SIGN_IDENTITY[sdk=iphoneos*]" means and what is the differences to CODE_SIGN_IDENTITY and whether CODE_SIGN_IDENTITY is needed and whether Apple has something documented about this anywhere?

所以回到我的问题,有没有人知道“CODE_SIGN_IDENTITY[sdk=iphoneos*]”是什么意思,与 CODE_SIGN_IDENTITY 有什么区别,是否需要 CODE_SIGN_IDENTITY 以及 Apple 是否在任何地方都有记录?

采纳答案by zrzka

It's a new Xcode4 UI, which is quite complicated at first sight. You should read Xcode 4 User Guide and Xcode 4 Transition Guide. I'll try to explain it ...

这是一个新的 Xcode4 UI,乍一看相当复杂。您应该阅读 Xcode 4 User Guide 和 Xcode 4 Transition Guide。我会试着解释它...

Let's focus on Distribution row only. It does contain iPhone Distribution. The row below (Any iOS SDK) does contain more specific settings, which do overwrite Distribution row settings. In other words, you can set default signing identity for Distribution builds, but you can overwrite it for specific SDKs.

让我们只关注分布行。它确实包含 iPhone 发行版。下面的行(任何 iOS SDK)确实包含更具体的设置,这些设置会覆盖分布行设置。换句话说,您可以为分发版本设置默认签名标识,但您可以为特定 SDK 覆盖它。

You can do this for Debug, Release, etc. It just depends on your settings / project complexity.

您可以为调试、发布等执行此操作。这仅取决于您的设置/项目复杂性。

These things can be also set in different levels - iOS default, project default, target default. To see these levels, just go to Build Settings and switch Combined to Levels view (just under the Build Settings tab). Here you can find values for all levels. Resolved column does contain value, which will be really used.

这些东西也可以设置在不同的级别——iOS 默认、项目默认、目标默认。要查看这些级别,只需转到“构建设置”并将“组合”切换到“级别”视图(就在“构建设置”选项卡下)。在这里您可以找到所有级别的值。解析列确实包含值,这将被真正使用。

It's like a matrix where you can overwrite default/project/target settings in a row and build configuration settings for specific SDK's in a column.

它就像一个矩阵,您可以在其中覆盖一行中的默认/项目/目标设置,并在一列中为特定 SDK 构建配置设置。