Xcode:如何导出开发人员配置文件以便将其导入另一台 Mac
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34063583/
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
Xcode: How to export a developer profile in order to import it on another Mac
提问by LS_
I need to export my developer profile from my old Mac and import it on another Mac because I'm getting the following error:
我需要从旧 Mac 导出我的开发人员配置文件并将其导入另一台 Mac,因为我收到以下错误:
Your account already has a valid iOS Development certificate
您的帐户已有有效的 iOS 开发证书
I found out that I can export it from here:
But on my mac I have 2 accounts there, if I click export accounts do I export both of them? Because I just need one account. Is there any other solution? Like exporting the private key used to sign the iOS Development certificate and import it on the new Mac?
但是在我的 Mac 上,我有 2 个帐户,如果我单击导出帐户,我是否同时导出它们?因为我只需要一个账号。还有其他解决方案吗?像导出用于签署iOS开发证书的私钥并在新Mac上导入?
回答by Dave Wood
I'd recommend not using Xcode's export option, but instead to go into your Keychain Access.app, and copy the key/cert manually.
我建议不要使用 Xcode 的导出选项,而是进入您的 Keychain Access.app,并手动复制密钥/证书。
To do so, in Keychain Access, create a new keychain (by default it will be stored in ~/Library/Keychains
). Select your login
keychain, and then My Certificates
under Category
. You should now see your certificate in the right panel. It should have a disclosure arrow on the left side, and toggling that should show you your private key. Select the certificate, and copy/paste it into your new keychain (don't drag it, or it will remove it from your login
keychain).
为此,在钥匙串访问中,创建一个新的钥匙串(默认情况下,它将存储在 中~/Library/Keychains
)。选择您的login
钥匙串,然后My Certificates
在Category
. 您现在应该在右侧面板中看到您的证书。它的左侧应该有一个披露箭头,切换时应该会显示您的私钥。选择证书,然后将其复制/粘贴到您的新钥匙串中(不要拖动它,否则会将其从login
钥匙串中删除)。
Now you can copy that keychain to your new computer, open it in Keychain Access.app and copy the key/cert to your login
keychain there.
现在您可以将该钥匙串复制到您的新计算机,在 Keychain Access.app 中打开它并将密钥/证书复制到您的login
钥匙串中。
And the reason I don't recommend using Xcode for this, is exactly what you mention, that it exports all accounts. I've had clients in the past send me 'their developer key/cert' exported in this manner, that included the key/cert for dozens of other developers in their company.
我不建议为此使用 Xcode 的原因正是您提到的,它导出所有帐户。我过去曾有客户向我发送以这种方式导出的“他们的开发人员密钥/证书”,其中包括他们公司中数十名其他开发人员的密钥/证书。
回答by metakermit
The way I solved it was to:
我解决的方法是:
- export all accounts as your personal backup (good to have in a secure place anyway, in case you lose your machine)
- delete all developer accounts in Xcode Accounts manager (Xcode - Preferences - Accounts) exceptfor the account you want to share with your team
- repeat the same
backup/delete_all_but
procedure in Xcode Keychain app for "my certificates" (not 100% sure this is necessary, but doesn't hurt) - export the remaining developer account(s) from Xcode Accounts manager and share it with your team
- import your backup to have everything on your machine again (and delete duplicates if necessary). You might have to log in to your Apple ID again from the Xcode Accounts manager
- 导出所有帐户作为您的个人备份(无论如何,最好将其放在安全的地方,以防您丢失机器)
- 删除 Xcode Accounts manager (Xcode - Preferences - Accounts) 中的所有开发者帐户,除了您要与团队共享的帐户
backup/delete_all_but
在 Xcode Keychain 应用程序中为“我的证书”重复相同的过程(不是 100% 确定这是必要的,但不会造成伤害)- 从 Xcode 帐户管理器导出剩余的开发者帐户并与您的团队共享
- 导入您的备份以再次在您的机器上保存所有内容(并在必要时删除重复项)。您可能需要从 Xcode 帐户管理器再次登录您的 Apple ID