我无法在 Xcode 中将 iOS 分发签名身份添加到我的帐户

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27173425/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:16:09  来源:igfitidea点击:

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

iosxcode

提问by Ivan Porkolab

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

我有两个不同的配置文件,在 Xcode 中有两个不同的 Apple ID,第一个是个人的,第二个是我在工作中使用的帐户。

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.

问题是,我通常可以将 iOS 分发签名身份添加到我的个人帐户。如果我删除它,我可以简单地通过 Xcode->Preferences->Accounts->View Details->'plus sign'->'iOS Distribution' 添加它。
它只是工作,它应该。

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.

另一方面,在我的企业帐户中,我被添加到几个开发团队中。在某些情况下,我只是会员,在某些情况下,我被添加为会员,但我的权限被提升为管理员,而在某些情况下,我从一开始就被添加为管理员。
在这些团队中,我无法使用我的企业帐户添加 iOS 分发签名标识。有时,我收到错误消息“您的帐户已经拥有有效的 iOS 分发证书”,但大多数情况下它只是旋转微调器而什么也不做。

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.

请注意,Apple 建议当您将帐户从一台计算机迁移到另一台计算机时会发生“您的帐户已经具有有效的 iOS 分发证书”错误,但此处并非如此。我一直在使用同一台计算机 - 另外 - 从我被添加为每个团队的团队成员/管理员的第一刻起,问题就发生了。

Thank you.

谢谢你。

采纳答案by Ivan Porkolab

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>.pemfile, and other is private - <fileNamePrivate>.p12file.

  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.

  1. 使用钥匙串,在 iOS 分发签名标识工作的计算机上导出有效证书。您需要两个文件,一个是公共<fileNamePublic>.pem文件,另一个是私有<fileNamePrivate>.p12文件。

  2. 将这些文件放在需要签名身份才能工作的计算机上的文件夹中。

  3. 打开终端并浏览到您放置它们的文件夹。

  4. 首先,键入: security import <fileNamePrivate>.p12 -k ~/Library/Keychains/login.keychain

  5. 然后输入: security import <fileNamePublic>.pem -k ~/Library/Keychains/login.keychain

  6. 打开XCode,进入XCode>preferences>accounts>view details,刷新你使用的apple id

  7. 您应该启用签名身份。

回答by ctapp1

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

1.) 在苹果开发者门户上登录您要用于分发的apple id 帐户

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.

2.) 转到证书并生成新的分发/内部证书。您只能拥有两个分发证书(据我所知),因此您可能需要删除一个。如果您删除,请确保这不会弄乱使用该特定证书的其他人。

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

3.) 按照步骤通过“从证书颁发机构请求证书”将新证书添加到您的钥匙串中。

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

4.) 将新制作的证书添加到您将用于分发的配置文件中。

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

5.) 进入 xCode>preferences>accounts>view details 并刷新您正在使用的 apple id

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

6.) 现在,当您提交应用程序进行分发时,请确保使用新添加的证书将构建设置>代码签名设置为正确的配置文件

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.

7.) 转到 Targets>project>general 并确保您的 bundle Id 是正确的,并且您的团队在您的 Apple ID 中设置为正确的团队。

回答by Ryde

I'm using xCode 7.2. On the Account details xCode>Preferences>Accounts>View details... There is option to create one if it's (certificate) not there yet. It will automatically revoke your provisioning profile though. You need to edit and download again from member center.

我正在使用 xCode 7.2。在帐户详细信息 xCode>Preferences>Accounts>View details... 如果(证书)尚不存在,则可以选择创建一个。不过,它会自动撤销您的配置文件。需要在会员中心重新编辑下载。