1

Ok, I am completely pulling my hair out on this one.

Back in July I created a provisioning profile so I could test on my iPad.

Then at the end of August I tried submitting my first App to the iTunes Store. The process was a complete nightmare, and I struggled. A lot. In the end I found a tutorial with relatively recent information in it, and only by following it step by step could I actually get anywhere with this. Unfortunately the result of this was that I created a new provisioning profile.

Now when I try to test on my iPad I get the following error in Xcode:

Certificate identity 'iPhone Developer: MyName' appears more than once in the keychain. The codesign tool requires there only be one.

I check the keychain, and sure enough there are the two provisioning profiles for development, one from July and the one I used to submit to the iTunes Store in August.

Now what I want to do is get rid of the old one, and then connect my iPad up to the new one. I can get rid of the old one fine, but I cannot connect my iPad to the new one, it insists on using the old profile, even to the point of re-attaching it to the keychain after Ive deleted it.

Can anyone tell me:

How to connect my iPad to the new provisioning profile?

And while we are at it, can anyone shed any light on why this entire process is so convoluted and difficult? Considering that so much of Apples interface is so well designed and fluid, this process of registering certificates and applying them to different devices and Apps seems so backwards. I initially suspected this was just me, but googling for these error messages reveals that there are many who are struggling at various points along this process.

4

2 回答 2

4

This has nothing to do with Xcode and everything to do with keychain.

  1. Open keychain.
  2. Find the signing certificates that are tied to your provisioning profiles.
  3. Delete one. You probably want to keep the newer one, so look at the expiration dates and remove the one that expires first.
  4. Restart Xcode

You may need to update your provisioning profile if it isn't tied to the new certificate, but it won't be as painful as creating a new certificate.

Here's a broad overview of how code signing in Xcode works. It a bit much but will explain what's wrong with your configuration, and how you can fix it.

  • There are three parts to the mechanism that ensures that you are who you say you are and that your app is allowed to run where it wants to.

    1. You've got a pair of keys, one public and one private. Your public key matches your private key, which identifies you.
    2. Your keys are used to generate certificates. Generally, you'll have one certificate for development and one for distribution,either on the App Store or via Ad Hoc distribution. These certificates permit you to provision your apps.
    3. Each certificate is used to generate provisioning profiles. The profiles must be attached to either a development or a distribution certification. A distribution profile either works on the App Store, or it contains a list of device IDs which may run apps signed with that profile.
  • If your certificate is expired, the provisioning profiles that are created with it are going to be invalid. In this case, replace both the certificate and the profiles. Generate a certificate signing request (CSR) from Keychain Access and upload it to the developer portal.

  • If you have multiple certificates in your keychain, Xcode won't know which one to use. This may happen if you renew your certificate and don't remove the old one. (It may also happen if you exported your developer profile and then imported it later. Your old certificates will carry over.)

  • If your provisioning profile is expired or invalid, you can renew it in the developer portal without generating a new CSR. You can just attach it to an existing valid certificate.

Certificates can't be carried over from one machine to another without moving the original key pair that requested it. Exporting the certificate from Keychain will export the keys as well.

于 2013-09-02T13:42:26.120 回答
0

Delete the old one, and start build with new. One more way you can try , set code signing identity with profile you want to run in both target as well as project build setting. Hope it will help you. Otherwise you have to delete old one.

于 2013-09-02T13:38:31.720 回答