1

I'm trying to start from scratch with all my keys for iOS development by deleting them, recreating them, and downloading and installing the new ones.

The problem is that I keep deleting the iPhone Developer: MyName certificate (no private key associated with it), but when I run Xcode, it generates a new one.

Is there a better way to start from scratch with all these certificates and profiles?

Charlie
  • 11,380
  • 19
  • 83
  • 138

3 Answers3

3

I had the same problem. I think if Xcode finds the old certificates on your iPhone or in any of the mobileprovision files for the apps in your organiser then it re-imports them.

try deleting all the provisioning profiles from xcode and from your iPhone. Eventually if you delete all references to the certificates it will stop restoring them.

Nick Lockwood
  • 40,865
  • 11
  • 112
  • 103
  • I agree; my experience was similar, and I posted a lengthy description here: http://stackoverflow.com/questions/2177143/how-to-renew-an-iphone-development-certificate/13426659#13426659 – matt Dec 05 '12 at 16:53
2

XCode will generate one by default, that as you may see in the developer portal cannot be edited and says "Managed by XCode", you can use that one if you wish for testing, and then simply select the one you wish to use in your target code signing settings.

To start from scratch:

1) Delete and create a new certificate
2) Create a new profile with this certificate
Oscar Gomez
  • 18,436
  • 13
  • 85
  • 118
  • The only item that says "Managed by Xcode" is my `iOS Team Provisioning Profile: *` but it says that is invalid... – Charlie Jan 20 '12 at 14:50
  • @Charlie have you revoked the certificate?, and created a new one. – Oscar Gomez Jan 20 '12 at 14:51
  • I revoked every certificate but not the Team Provisioning profile as it has no option for that. In Xcode is says it can't find a valid private key/certificate pair for it, which is probably because I haven't created a new developer certificate? – Charlie Jan 20 '12 at 14:53
  • @Charlie Yes you need to create a new development certificate (you should only have one), so revoke that one, and create a new one. – Oscar Gomez Jan 20 '12 at 14:55
  • Okay, Xcode is now showing an active `Team Provisioning Profile` and my `iPhone Developer` and `iPhone Distribution` certificates in the Developer Profile section of Xcode. Is there anything else I should know about the various certificates? – Charlie Jan 20 '12 at 15:01
  • Ugh, when I try to Archive my project and save it as an .ipa file for distribution, the "iPhone Distribution" option is greyed out saying "does not match any valid identity/profile pairs" – Charlie Jan 20 '12 at 15:04
  • @Charlie have you created a new distribution profile using the new certificate?, you might also need to set your Code signing in your Target to the new Distribution profile – Oscar Gomez Jan 20 '12 at 15:06
  • It seems like it's working now, I had to create a provisioning distribution profile and it seems like eveything's ok. – Charlie Jan 20 '12 at 15:18
1

I think I had the same problem recently. When you delete it you probably are in the Category 'All Items' in the Keychain Access tool. This means the the private key doesn't get shown/deleted. You should try deleting it from the certificates view. After I did that it never reappeared. :-).

edit: Seems to be a common problem ;-)

Jeroen Coupé
  • 1,394
  • 11
  • 13