從xcode3時代習慣了手動選擇證書,即 Provisioning Profile和 Code Signing Identify.
而隨着團隊擴大,應用量增多,需要管理的證書也越來越多,每次從長長的list中尋找需要的那個證書,心情都有點憂傷。
而蘋果也給出了更合適的解決方案,xcode 自動選擇provisioning profile。這個方案的好處在於,更換證書、團隊使用證書不同等情況下,無需再重新設置證書信息。
以ios工程為例,以下列出最核心步驟:
1、Project -> Build Settings 中,
Provisioning Profile 全部選擇 Automatic,
Code Signing Identify 全部選擇 iOS Developer

2、Target -> General 中, Team 設置為 None

3、Target -> Build Settings 中,
Provisioning Profile 全部選擇 Automatic,
Code Signing Identify 全部選擇 iOS Developer

4.Target -> General 中,
Team 重新設置為 你的團隊

大功告成!
Q1.這里有一個疑問,就是證書全部勾選為iOS Developer,提交itunesconnect怎么辦?
A.使用Xcode的archive,然后使用Xcode提交itunesconnect。Xcode會對安裝包重新簽名
Q2.重新安裝證書后怎么辦?
A.Xcode會自動重新選擇合適的證書
Q3.更換bundle id后,需要重新設置嗎?
A.更換bundle id,Xcode仍會自動選擇合適證書
Q4.有特殊需求,需要打包distribution但不提交itunesconnect,怎么辦?
A.特殊情況時,手動選擇以下Target的證書。打包完后再設置回來
Q5.上述操作步驟是否有順序要求?
A.根據蘋果官方文檔描述,Team必須在重置證書前設置為None,在重置證書后設置為團隊。Note: It's just as important to set Target > General > Team to None before reverting all the code signing build settings to their defaults, as it is to set it back to the value of your team afterwards.
