Why does Xcode auto-install a (duplicate and expired) certificate in the keychain? [duplicate]
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:
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, tha开发者_StackOverflow社区t causes extra confusion. So I delete it in keychain, and build the project and everything works.
Quit Xcode, restart, watching Keychain, and TA-DA! the expired certificate reappears.
I feel like I'm back on a virus-infected windows machine.
Since the project builds and executes properly when the cert is deleted, the only problem is the automatic installation xcode does.
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. :)
I had the same experience with XCode 3 (not 4) and removing the old certificate in Keychain only wouldn't work.
I also add to remove all of my old provisioning profiles using the old certificate with Organizer then quit XCode, remove the old certificate from Keychain and restart XCode.
Now it seems to work fine!
You might want to try the solution from xCode 4 -reinstalls keychain certs that I delete
Kind regards, Frank
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?
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.
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)
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.
For posterity, here's the strategy to get around this problem in our automated build script:
- Before building, move the ~/Library/MobileDevices/Provisioning Profiles directory aside
- Check to see if the iPhone Configuration Utility is 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 Profiles directory back
- Profit?
精彩评论