天天看點

多台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.

  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個檔案即可

繼續閱讀