Multiple Certificates/Provisioning Profiles in one Xcode organizer?
Asked Answered
V

3

18

There are several similar questions here, but none could answer my basic question:

Is it possible to have two separate developer certificates in the keychain and two corresponding distribution profiles in Organizer?

I have my own (working) developer certificate and provisioning profile for my own iPhone apps. Now I finished a project for a client and would like to use his developer account/certificates/provisioning profiles to submit his app to the app store on his account.

Is that even possible?

So far I downloaded and installed his certificates and they show up in my keychain, and I installed his provisioning profile in Organizer, but Organizer tells me "A valid signing identity matching this profile could not be found in your keychain.". Likewise, the archive build fails.

I couldn't find a way to tell Organizer to use the certificate of my client instead of my own-I think this is the problem.

Thanks for any help!

Vase answered 10/2, 2011 at 12:20 Comment(2)
have you set the appropriate values in the build settings?Layman
I couldn't set the code signing identity to the distribution profile-it was greyed out, presumably because Organizer couldn't find the signing identity. But it works now, see below.Vase
D
27

Yes I've produced app store builds of projects for clients several times using their distribution certificate. No need to use their developer certificate. There are many things can could go wrong here, if you have access to the client's account you can go on to the provisioning portal and check things out:

  • make sure the bundle ID in the project settings exactly matches the app ID on the iOS provisioning portal (com.company.appname usually)

  • make sure the app store distribution provisioning profile is marked as "valid" and shows up under the distribution certificate.

  • make sure the app store build config in xcode references the client's distribution cert.

  • open your keychain and make sure that the client distribution cert also has its accompanying private key. This may be the problem, it's the part usually left out. The client must export his private key for his dist cert and send it to you in the .p12 file along with the password to the .p12 file. The dist cert can't be used to sign the app without the private key!

  • sometimes just quitting Xcode and restarting it helps.

Drumlin answered 10/2, 2011 at 12:34 Comment(3)
That was exactly the kind of check list I was hoping for, and you were right, I missed the private key. Works perfectly now. Thank you so so much, you made my day.Vase
Glad to be able to help you out of "signing failure hell". Wouldn't it be nice if the Apple error message said, "certificate missing private key"?Drumlin
"sometimes just quitting Xcode and restarting it helps" worked in my case, I'd recommend doing so as your first step if you encounter this issueOfilia
T
7

See this solution to duplicate certificates: http://tapadoo.com/2012/certificates-magically-re-appearing-in-your-keychain-try-this/

The gist is that if you have an old private key and provisioning profile around, you can run into a case where Xcode will re-create an old certificate in your keychain. This will make code signing gag because it requires a single certificate with a given name. Deleting the old private key will resolve this issue.

Thrombin answered 6/7, 2012 at 12:54 Comment(1)
While this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.Coyle
C
2

EASY MODE

(I hate these archaic export errors so bad. So many hours wasted. I'm not religious but I still pray this helps you)

  • Log into https://developer.apple.com
  • go to Certificates, Identifiers & Profiles
  • bottom left: Provisioning Profiles
  • Delete any duplicates / invalid profiles (in my case I only had one but it was invalid)

Note: if you're trying to export an archive, you can leave the export window open, delete a provisioning profile, then click "retry" or whatever the button says. This will save you from have to re-archive over and over

#xcode8.2.1 #osx10.11.6

Closelipped answered 16/3, 2017 at 17:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.