为什么 Xcode 会在钥匙串中自动安装(重复和过期)证书?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5335889/
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
Why does Xcode auto-install a (duplicate and expired) certificate in the keychain?
提问by Tom Pace
Possible Duplicate:
xCode 4 -reinstalls keychain certs that I delete
The question says it all in a nutshell.
这个问题简而言之就说明了一切。
When building a project in Xcode, I receive the error message from the Check dependencies step:
在 Xcode 中构建项目时,我从检查依赖项步骤收到错误消息:
CodeSign error: Certificate identity 'iPhone Developer: xxxxx' appears more than once in the keychain. The codesign tool requires there only be one.
Problem is, this certificate identity is reinstalled whenever Xcode is launched. It is an expired certificate too, that causes extra confusion. So I delete it in keychain, and build the project and everything works.
问题是,每当启动 Xcode 时,都会重新安装此证书身份。它也是一个过期的证书,这会导致额外的混乱。所以我在钥匙串中删除它,然后构建项目,一切正常。
Quit Xcode, restart, watching Keychain, and TA-DA! the expired certificate reappears.
退出 Xcode,重新启动,观看 Keychain 和 TA-DA!过期的证书再次出现。
I feel like I'm back on a virus-infected windows machine.
我觉得我又回到了受病毒感染的 Windows 机器上。
Since the project builds and executes properly when the cert is deleted, the only problem is the automatic installation xcode does.
由于项目在删除证书时可以正常构建和执行,唯一的问题是自动安装 xcode。
Edit:
编辑:
I think it's got to be related to an examination that xcode does of the keychain, for whatever reason. Then xcode decides to install the cert based on its checkup of keychain, though it's a faulty decision. I could probably solve this problem if I spent 24-48 hours, but I'm able to keep working, without quitting Xcode. :)
我认为它必须与 xcode 对钥匙串所做的检查有关,无论出于何种原因。然后 xcode 决定根据其对钥匙串的检查来安装证书,尽管这是一个错误的决定。如果我花 24-48 小时,我可能可以解决这个问题,但我可以继续工作,而无需退出 Xcode。:)
采纳答案by Dirty Henry
I had the same experience with XCode 3 (not 4) and removing the old certificate in Keychain only wouldn't work.
我对 XCode 3(不是 4)有相同的经验,并且仅删除 Keychain 中的旧证书是行不通的。
I also add to remove all of my old provisioning profiles using the old certificatewith Organizer then quit XCode, remove the old certificate from Keychain and restart XCode.
我还使用Organizer的旧证书添加删除所有旧配置文件,然后退出 XCode,从钥匙串中删除旧证书并重新启动 XCode。
Now it seems to work fine!
现在它似乎工作正常!
回答by Frank Schmitt
You might want to try the solution from xCode 4 -reinstalls keychain certs that I delete
您可能想尝试xCode 4 中的解决方案-reinstalls keychain certs that I delete
Kind regards, Frank
亲切的问候,弗兰克
回答by Adam
Not sure what's causing this for you, but two things to try out:
不确定是什么导致了这种情况,但有两件事要尝试:
Firstly ... Xcode has historically had some bugs in this area that are only cured by quitting Xcode, deleting stuff from keychain, rebooting OS X(really - no idea what's in XCode that can survive an app restart, but I've seen it happen), and then restarting XCode. I haven't seen any of those for well over a year, but could be a regression bug?
首先...... Xcode 历来在这方面存在一些错误,这些错误只能通过退出 Xcode、从钥匙串中删除东西、重新启动 OS X 来解决(真的 - 不知道 XCode 中有什么可以在应用程序重启后幸存下来,但我已经看到了发生),然后重新启动 XCode。我已经一年多没有看到任何这些了,但可能是回归错误?
Secondly ... although it doesn't handle certs, if you're not already you should be using iPhone Configuration Utility (http://support.apple.com/kb/dl851) for the provisioning profiles part if possible - it often provides manual fixes for Xcode bugs in this area.
其次......虽然它不处理证书,如果你还没有,你应该尽可能使用 iPhone 配置实用程序 (http://support.apple.com/kb/dl851) 作为配置文件部分 - 它经常为这方面的 Xcode 错误提供手动修复。
Oh, thirdly (nobody expects the spanish inquisition): if you check Console, it sometimes contains extra debugging / error info for the commandline tools in Xcode that deal with certs and cert-signing (including error messages that appear nowhere else)
哦,第三(没有人期望西班牙宗教裁判所):如果您检查控制台,它有时会包含 Xcode 中处理证书和证书签名的命令行工具的额外调试/错误信息(包括其他任何地方都没有出现的错误消息)
回答by vfn
Delete all your provisioning profiles liked to the expired certificate from organizer.
从组织者中删除所有喜欢过期证书的配置文件。
Go to the provisioning portal create the new certificate. After that for each provisioning profile, edit them by selecting the certificate checkbox on the edit page and save them, then re-download the profiles.
转到配置门户创建新证书。之后,对于每个配置文件,通过选择编辑页面上的证书复选框来编辑它们并保存它们,然后重新下载配置文件。
回答by Bryan
For posterity, here's the strategy to get around this problem in our automated build script:
对于后代,以下是在我们的自动构建脚本中解决此问题的策略:
- Before building, move the ~/Library/MobileDevices/Provisioning Profilesdirectory aside
- Check to see if the iPhone Configuration Utilityis running and close it (certs always reappear if this app is open. In XCode 4.1 you need to close the organizer too.)
- Run you build
- Move the Provisioning Profilesdirectory back
- Profit?
- 在构建之前,将~/Library/MobileDevices/Provisioning Profiles目录移到一边
- 检查iPhone 配置实用程序是否正在运行并关闭它(如果此应用程序打开,证书总是会重新出现。在 XCode 4.1 中,您也需要关闭管理器。)
- 运行你构建
- 将Provisioning Profiles目录移回
- 利润?