做过IOS测试的都知道,IOS的证书不经过处理只能在申请的机器上测试。有时候为了方便我们可能需要在不同的机器上测试。那么就需要处理一下证书了。下面给大家分享一下处理办法:
在需要增加测试的机器上下载 .cer 文件。(IOS证书)
然后在申请的机器上导出你的私有秘钥。{网上是这么说的从发送申请文件(certificate Request,后缀名为certSigningRequest)的机器上把证书对应的private key(.p12文件)导出,密码自己定,要记住,后面导入的时候要用。(右击你原来安装的文件导出)}
接着你需要在需要增加的测试的机器上安装证书(.cer),导入私钥文件(.p12)。安装对应App的provisioning profile。
只有经过这样的处理之后,这台新增加的机器才能够使用同一个证书测试开发的应用程序。
好了,试试吧。
iOS开发证书在多台机器上使用
有时不在一台机器上敲代码碰到需要真机调试的情况时,另一台机器由于没有安装证书而不能进行调试。映像中试过用从新申请证书的方法生成另外一张新证书但似乎一生成后原有的机器又不能调试了,最近发现一种极其简单的方法可以将一个证书在多台机器上使用(黑苹果中一样使用哦)。
- 打开有证书机器A的xcode -> Organizer
- 在A机器Organizer左边的TEAMS下可以看到已安装的证书,点击Export,设置密码和保存位置。
- 在另外一台机器B上打开xcode -> Organizer
- 在B机器Organizer左边的TEAMS下点Import,选择第2步导出的文件,输入密码。
- 测试,收工。
直接从已安装好的机器上导出私有密钥的,具体方法如下:
Xcode的organizer的IPHONE DEVELOPMENT --->Developer Profile里自带的Export和Import操作
导出私钥成功之后,把私钥Copy到需要安装的机器上,进行私钥导入:
按照上图的步骤操作完之后,就可以在xCode中选择编译的证书,进行真机联机调试
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.