先在Xcode的 codesing 選項(xiàng)卡中選中指定的provisioning profile ,再設(shè)置code singing identity.`
寶寶心里苦
Certificates里面是所有的證書(shū),包括發(fā)布證書(shū),調(diào)試證書(shū),推送證書(shū)等,下載下來(lái)雙擊會(huì)保存到你電腦的鑰匙串中.
Identifiers就是你程序的ID,唯一標(biāo)示符的東西
Devices 配置你的調(diào)試設(shè)備的地方
Provisioning ProfilesXcode的配置文件,你電腦上只有證書(shū)還不行,還需要下載XCode的配置文件,這里有調(diào)試文件,發(fā)布文件.下載下來(lái)后打開(kāi),會(huì)彈出XCode,在
target->Build Settings->Code Signing選項(xiàng)卡中:
1.選擇Provisioning Profile,選中你下載的文件.
2.選擇Code Signing Identity - >DeBug,選擇你的開(kāi)發(fā)配置文件
3.選擇Code Signing Identity - >Release,選擇你的生產(chǎn)配置文件
no identity foundCommand /usr/bin/codesign failed with exit code 1
I had the same issue. I fixed it through the following method :
Xcode > Preferences > Accounts > View Details > And just refresh the Provisioning Profile
Then Restart the Xcode and Clean and Build.

證書(shū)失效問(wèn)題
請(qǐng)去官網(wǎng)下載最新的AppleWWDRCA.cer文件
然后刪除鑰匙串中的舊證書(shū),一定要?jiǎng)h舊證書(shū),否則證書(shū)會(huì)一直是紅色的 證書(shū)失效.