多台Mac电脑使用同一个apple开发者账号测试
我的情况是这样的,公司有一个开发者账号,我个人的机器上没有装开发者证书,写的程序无法在真机上测试,因此我今天的任务就是在已有开发者账号、证书的基础上给自己电脑装上。
今天给自己的macbook装上了公司的apple开发者账号,以前总是用我的机器写代码但因为没有开发者账号不能给真机装也不能在真机上测试,想测试还需要把代码转移到其他机器上,很不方便,刚在网上找到一些方法装上了账号。感觉这个问题还是很普遍的,而且今天就为装这个也费了不少功夫有很多方法都没走成,因此把它总结出来,方便更多人能很快装上~
我的情况是这样的,公司有一个开发者账号,我个人的机器上没有装开发者证书,写的程序无法在真机上测试,因此我今天的任务就是在已有开发者账号、证书的基础上给自己电脑装上。
我之前是用账号登陆apple developer网站,从网站上下载了公共证书,但最后实验成功的那个帖子上没有以前做的那些步骤,他是直接从已安装好的机器上导出私有密钥的,具体方法如下:
首先就是按照下面说的:
When you request a certificate from the iPhone Provisioning Portal, a public/private key pair is generated. The public key is included in your certificate. The private key is stored in your keychain. With these items, Xcode code-signs the applications you build with it. If you need to use another computer to develop iOS applications, you must transfer these digital-identification items to the other computer. You can do this in the Xcode Organizer.
To export your digital-identification items to a secure file, follow these steps:
Open the Xcode Organizer.
In the IPHONE DEVELOPMENT group, select Developer Profile.
Click Export Developer Profile.
Name the file, select a location for it, enter a password to secure the file, and click Save.
Now, when you need to develop iOS applications on another computer, import your digital-identification items into it by performing these steps:
Copy the developer-profile archive to the second computer.
On the second computer, launch Xcode.
Open the Organizer.
In the IPHONE DEVELOPMENT group, select Developer Profile.
Click Import Developer Profile.
Locate the archive, enter the password used to secure it, and click Open.
关键的一点就是不是直接从keychain里导出.cer文件,而是利用Xcode的organizer的IPHONE DEVELOPMENT ---》Developer Profile里自带的Export和Import操作
上述方法解决了一个很关键的问题:私有密钥安装问题,如果还有什么证书没装的可以参考下文共装4个文件即可