今天给一个项目换证书的时候遇到了这个问题:

Code Sign error: Provisioning profile does not match bundle identifier: The provisioning profile specified in your build settings (“aaa”) has an AppID of “com.bbb” which does not match your bundle identifier “com.ccc”.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.4'

如图所示:

【iOS】更换证书遇到的问题_bundle

 

后来发现是因为 Tests 文件的 Bundle Loader 出了问题(两天后凭记忆写的,应该是这个【可能不对,应该是 Tests 中的证书没修改,记不清了。。】),如图所示:

【iOS】更换证书遇到的问题_bundle_02

删除 后解决了!