多臺Mac電腦使用同一個apple開發者賬號開發測試

安迪潘發表於2011-10-24

        今天給自己的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個檔案即可

http://blog.csdn.net/dotphoenix/article/details/5342388


相關文章