Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't add iOS distribution signing identity to my account in Xcode [closed]

Tags:

xcode

ios

I have two different profiles with two different Apple IDs in Xcode, first is personal and second is account I use on work.

The thing is, I can normally add iOS distribution signing identity to my personal account. If I delete it, I can simply add it thru Xcode->Preferences->Accounts->View Details->'plus sign'->'iOS Distribution'.
It just works, as it should.

On the other hand, on my business account, I am added to several development teams. On some I am just a member, on some I was added as a member but my rights were elevated to admin, and on some I have been added as an admin right from the beginning.
On none of those teams, using my business account, I cannot add iOS distribution signing identity. Some times, I get an error "Your account already has a valid iOS Distribution certificate" but most of the time it just spins the spinner and does nothing.

Just a note, Apple suggests that "Your account already has a valid iOS Distribution certificate" error happens when you migrate your account from one computer to another, but that is NOT the case here. I am using the same computer all the time - plus - issue is happening from the first moment I was added as a team member/admin to each of those teams.

Thank you.

like image 614
Ivan Porkolab Avatar asked Nov 27 '14 14:11

Ivan Porkolab


People also ask

What happens if distribution certificate expires iOS?

If your certificate expires, passes that are already installed on users' devices will continue to function normally. However, you'll no longer be able to sign new passes or send updates to existing passes. If your certificate is revoked, your passes will no longer function properly.

How do I enable signing in Xcode?

Open the project using Xcode. Select the root project directory, and go to the Signing and Capabilities tab. Here, you can either check Automatically manage signing or do the signing manually. If you check the Automatically manage signing checkbox, then you will just need to select the Team from the drop-down list.


2 Answers

What always works for me if I get code signing identity errors is to...

1.) Sign into the apple id account you wish to use for distribution on the apple developer portal

2.) Go to certificates and generate a new distribution/in-house certificate. You can only have two distribution certs (as far as I know) so you may have to delete one. Make sure this doesn't mess up others using that specific cert if you delete.

3.) Follow the steps to add the new cert to your keychain by 'requesting a certificate from certificate authority'.

4.) Add the newly made certificate to the provisioning profile you will use for distribution.

5.) Go into xCode>preferences>accounts>view details and refresh the apple id you are using

6.) Now when you submit your app for distribution, make sure your build settings>code signing are set to the correct provisioning profile with the newly added certificate

7.) Go to Targets>project>general and make sure your bundle Id is correct and your team is set to the correct team within the your apple id.

like image 76
ctapp1 Avatar answered Oct 19 '22 20:10

ctapp1


We have finally managed to solve the issue.
What worked for me is:

  1. Using keychain, export valid certificate on a computer on which iOS distribution signing identity works. You need two files, one is public - <fileNamePublic>.pem file, and other is private - <fileNamePrivate>.p12 file.

  2. Put those files in a folder on computer on which you need signing identity to work.

  3. Open terminal and browse to the folder you've put them in.

  4. First, type: security import <fileNamePrivate>.p12 -k ~/Library/Keychains/login.keychain

  5. Then type: security import <fileNamePublic>.pem -k ~/Library/Keychains/login.keychain

  6. Open XCode, go to XCode>preferences>accounts>view details and refresh the apple id you are using

  7. You should have signing identities enabled.

like image 32
Ivan Porkolab Avatar answered Oct 19 '22 19:10

Ivan Porkolab