ios Xcode - 代码签名身份自动?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24235218/
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
Xcode - code signing identity automatic?
提问by allaire
What's the meaning of the Automatic
code signing identity in Xcode 5 under the build settings tab? When I pick iOS Developer
, both Debug and Release use it. What should I use? Will I be able to distribute app with the iPhone Developer identity for relase?
Automatic
Xcode 5 中构建设置选项卡下的代码签名标识是什么意思?当我选择时iOS Developer
,Debug 和 Release 都使用它。我应该使用什么?我可以发布带有 iPhone 开发者身份的应用程序以供发布吗?
My provisioning profiles (the setting under) are correctly set (Debug
use Team provisioning profile
and Release
use my ad-hoc profile), what's different between the code signing identity setting and the provisioning profile one?
我的配置文件(下面的设置)已正确设置(Debug
使用Team provisioning profile
并Release
使用我的临时配置文件),代码签名身份设置和配置文件有什么不同?
Here's some screenshots of what I'm talking about:
这是我正在谈论的一些屏幕截图:
Also, When I put Automatic
to both Debug
and Release
, it marks it as Don't code sign
, why?
另外,当我Automatic
同时使用Debug
and 时Release
,它会将其标记为Don't code sign
,为什么?
Edit:
编辑:
Is iPhone Developer
also valid for release? should I select Automatic/iPhone Distribution?
是否iPhone Developer
还有效释放?我应该选择自动/iPhone 分发吗?
As you can see, i'm pretty confuse about all the settings Xcode propose with code signing identity, so any clarification about each one is welcomed, thanks!
如您所见,我对 Xcode 提出的所有设置与代码签名标识感到非常困惑,因此欢迎对每一个设置进行澄清,谢谢!
回答by Colin Humber
The automatic setting should automatically use the correct certificate to sign your app with based on the provisioning profile set in the bottom option in the Code Signing section. You can explicitly set both the Code Signing Identity as well as the Provisioning Profile, or set the Code Signing Identity to Automatic. If you select Automatic, Xcode will automatically use the certificate associated with the provisioning profile.
自动设置应根据代码签名部分底部选项中设置的配置文件自动使用正确的证书为您的应用程序签名。您可以明确设置代码签名标识和供应配置文件,或将代码签名标识设置为自动。如果您选择自动,Xcode 将自动使用与配置文件关联的证书。
For example, if the Debug provisioning profile is a development profile, and the Release provisioning profile is set to an ad hoc profile, when you Build and Run (which typically uses the Debug configuration), Xcode will sign your app with the Development certificate associated with the development profile. If you Archive your application (which typically uses the Release configuration), Xcode will sign your app with the Distribution certificate associated with the Ad Hoc profile.
例如,如果调试配置文件是一个开发配置文件,而发布配置文件设置为一个临时配置文件,当您构建和运行(通常使用调试配置)时,Xcode 将使用关联的开发证书签署您的应用程序与开发配置文件。如果您存档您的应用程序(通常使用发布配置),Xcode 将使用与 Ad Hoc 配置文件关联的分发证书对您的应用程序进行签名。
Basically, it's just a way to let Xcode decide which certificate should be used based on the Provisioning Profile.
基本上,这只是让 Xcode 根据 Provisioning Profile 决定应该使用哪个证书的一种方式。
The last line in the "Setting the Code Signing Identity Build Setting" section herealludes to this but isn't overly explicit.
此处“设置代码签名身份构建设置”部分的最后一行暗示了这一点,但并不过分明确。
Set the Provisioning Profile build setting to your development profile and the Code Signing Identity build setting to your development certificate.
将 Provisioning Profile 构建设置设置为您的开发配置文件,将 Code Signing Identity 构建设置设置为您的开发证书。
回答by raurora
The main idea behind Code Signing is to certify that an app was created by you and easily detect any changes in your app. So, after you choose a Provisioning Profile, Xcode automatically sets the Code Signing Identity build setting to “iPhone Developer” for iOS apps. It just works fine, your app is code signed the next time you build it.
代码签名背后的主要思想是证明应用程序是由您创建的,并轻松检测应用程序中的任何更改。因此,在您选择 Provisioning Profile 后,Xcode 会自动将代码签名身份构建设置设置为 iOS 应用程序的“iPhone Developer”。它运行良好,您的应用程序在您下次构建时进行了代码签名。
This threadanswers your specific question with screenshots.
该线程通过屏幕截图回答您的具体问题。
Apple documentationalso suggests that -
Apple 文档还表明 -
If necessary, from the Code Signing Identity pop-up menu, choose your development certificate.
For iOS apps, choose the certificate in the provisioning profile menu item that begins with the text “iPhone Developer:” followed by your name.
如有必要,从代码签名身份弹出菜单中,选择您的开发证书。
对于 iOS 应用程序,请在配置文件菜单项中选择以文本“iPhone 开发人员:”开头,后跟您的姓名的证书。
About Automatic Profile Selector, this is what Apple documentationsays -
关于自动配置文件选择器,这是苹果文档所说的 -
Your Provisioning Profile or Signing Identity Doesn't Appear in Xcode Menus Occasionally, your provisioning profile or signing identity doesn't appear in a Provisioning Profile or Signing Identity pop-up menu when distributing your app using the Devices organizer or when setting the Code Signing Identity build setting in the project editor. When this occurs, refresh provisioning profiles in Xcode, as described in “Refreshing Provisioning Profiles in Xcode.”
If your provisioning profile still doesn't appear in the Code Signing Identity build setting menu, choose Don't Code Sign or a certificate under Automatic Profile Selector from the Code Signing Identity menu. The next time you choose the Code Signing Identity menu, your provisioning profile should appear in the menu.
您的配置文件或签名标识未出现在 Xcode 菜单中有时,在使用设备管理器分发您的应用程序或设置代码签名时,您的配置文件或签名标识不会出现在配置文件或签名标识弹出菜单中项目编辑器中的身份构建设置。发生这种情况时,请刷新 Xcode 中的配置文件,如“在 Xcode 中刷新配置文件”中所述。
如果您的配置文件仍然没有出现在代码签名身份构建设置菜单中,请从代码签名身份菜单中的自动配置文件选择器下选择不要代码签名或证书。下次您选择 Code Signing Identity 菜单时,您的配置文件应该会出现在菜单中。