XCode:此 Mac 上未安装“<foo> (from '<bar>')”的私钥

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19761557/
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 04:15:01  来源:igfitidea点击:

XCode: The private key for "<foo> (from '<bar>')" is not installed on this Mac

iosiphonexcodeprovisioning-profile

提问by aaronsnoswell

I have previously developed and released an iOS App with 'Company A'. Company A has just recently transferred ownership of the Application to 'Company B' (as per the instructions at the bottom of this iOS developer document). This worked fine and the App now shows up in iTunes Connect under Company B's account.

我之前曾与“A 公司”开发并发布了一个 iOS 应用程序。公司 A 最近刚刚将应用程序的所有权转让给了“公司 B”(按照此 iOS 开发人员文档底部的说明)。这运行良好,该应用程序现在显示在 B 公司帐户下的 iTunes Connect 中。

I am now attempting to release an update for the App and having problems with XCode. I have removed all previous accounts from XCode, added the Company B account, build the new App and archived it, but when I try to 'Validate' or 'Distribute' from the XCode organiser, I get the error

我现在正在尝试发布该应用程序的更新,但在使用 XCode 时遇到了问题。我已经从 XCode 中删除了所有以前的帐户,添加了 B 公司帐户,构建了新的应用程序并将其存档,但是当我尝试从 XCode 组织者“验证”或“分发”时,出现错误

The private key for "Company A (from 'Company B')" is not installed on this Mac.

此 Mac 上未安装“A 公司(来自“B 公司”)”的私钥。

XCode Code Signing Error Screenshot

XCode 代码签名错误屏幕截图

I have tried removing all iPhone Developer and iPhone distribution certificates from my Keychain, then revoking the Company B developer and distribution certificates, then re-creating them and installing them in my Keychain, but the error is the same.

我曾尝试从我的钥匙串中删除所有 iPhone 开发人员和 iPhone 分发证书,然后撤销 B 公司开发人员和分发证书,然后重新创建它们并将它们安装在我的钥匙串中,但错误是一样的。

What do I need to do to correct this error?

我需要做什么来纠正这个错误?

回答by Jasper Blues

One way to solve this problem, as you've indicated, is to make a new provisioning profile from a newly generated public/private key pair.

正如您所指出的,解决此问题的一种方法是根据新生成的公钥/私钥对创建新的配置文件。

Another way to solve this problem is to export the settings (ie private key) from a previous installation of Xcode (if you still have them) and port them to the new installation. In 'Organizer' choose 'Export Settings'.

解决此问题的另一种方法是从先前安装的 Xcode(如果您还有它们)导出设置(即私钥)并将它们移植到新安装。在“组织者”中选择“导出设置”。

The latter option is useful in a multi-member team scenario where you'd like to avoid disrupting other team members.

后一个选项在您希望避免干扰其他团队成员的多成员团队方案中很有用。

回答by aaronsnoswell

I managed to resolve this issue by creating a completely new provisioning profile in the iTunes Connect Provisioning Portal, then signing the code with that profile.

我通过在 iTunes Connect Provisioning Portal 中创建一个全新的配置文件,然后使用该配置文件对代码进行签名,设法解决了这个问题。

回答by ajbraus

I created a new Distribution certificate, then edited my existing provisioning profile to point to that new certificate, then in Xcode > preferences > account > view details I updated my signing certificates.

我创建了一个新的分发证书,然后编辑了我现有的配置文件以指向该新证书,然后在 Xcode > 首选项 > 帐户 > 查看详细信息中更新了我的签名证书。

worked like a charm

像魅力一样工作