1

I have set up a distribution profile for my IOS App. On Mac A, in Xcode this profile can be perfectly imported and used even the right distribution certificate is used. and now I can successfully upload app to app store via MAC A.

I have added distribution certificate in MAC A's keychain and then i exported certificated from it. Later I imported it to MAC B's keychain.

Now on another machine MAC B, if i import the same provisioning profile in XCode, it doesn't recognises distribution certificate.

Can someone throw some light on this whats going on here ?

pjs
  • 18,696
  • 4
  • 27
  • 56
Relsell
  • 771
  • 6
  • 18

2 Answers2

2

Based on your information, you have only imported the certificate to Mac B. In order to use that certificate to actually sign a binary, you will need to export the private key from Mac A. You will find it in the Keychain Access app on Mac A. Find the iOS Distribution certificate in the Keychain and you should be able to expand it to see the private key (note that you will not be able to expand the certificate in the Keychain app on Mac B). See this answer for details about how it should look in on a Mac that is setup to allow for code signing.

Once you find the private key, you can export the private key from Mac A by right clicking it and choosing export. Save the .p12 file and then copy that .p12 file to Mac B. Open the file to import it to the Keychain. Once you ahve done that, you should now see the private key under the certificate on Mac B. If you don't, you have the wrong certificate on Mac B and you should delete it and export the certificate from Mac A to import on Mac B.

wottle
  • 13,095
  • 4
  • 27
  • 68
  • Thanks for answering .... yes i tried doing the way you suggested... but still problem is there....somehow my macb xcode doesn't recognise exported . certificate.. but thanks a lot for answering. – Relsell Apr 25 '18 at 15:59
  • Xcode doesn't open the certificate. The certificate goes into your Keychain and then Xcode will try to use the cert to sign your app if there is a valid private key, and a provisioning profile set to use that cert. Can you show the certificate in the keychain on Mac B? – wottle Apr 25 '18 at 16:08
0

There are couple of factors which affects your Distribution Provisioning Profile, to find the issue you can check couple of things like

  1. Check in you MacB's Keychain > Certificate section about Distribution certificate is valid which you have installed from MacA?

  2. Does there is any expired certificate from same or different account in your keychain which is situated/placed above your Distribution certificate, because many times XCode fails to validate your desired certificate from Keychain due to some expired certificates entries above your certificate. So if any then please remove it.

  3. Try removing all provisioning profiles, then again install latest one. And finally try quit XCode completely and relaunch it. Many times this steps will solve issues regarding Provisioning profiles.

Dhaval Dobariya
  • 475
  • 4
  • 9