自己和同事升级Mac系统后,都遇到不能正常真机调试问题。
1.问题描述
主要表现为两种形式:
1.原来可以的证书现在点击不被信任。设置为始终信任后,一旦运行xcode会提示revoke证书。
2.或者编译不过,报错类似这种:
Showing Recent Messages
CodeSign ~/Library/Developer/Xcode/DerivedData/YiDing-fiptpxtujwvnricolywfszwdtqod/Build/Products/Debug-iphonesimulator/CTAssetsPickerController.bundle
cd ~/Downloads/MVVM-RAC-Demo-master/YiDing/Pods
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Signing Identity: "-"
/usr/bin/codesign --force --sign - --timestamp=none ~/Library/Developer/Xcode/DerivedData/YiDing-fiptpxtujwvnricolywfszwdtqod/Build/Products/Debug-iphonesimulator/CTAssetsPickerController.bundle
~/Library/Developer/Xcode/DerivedData/YiDing-fiptpxtujwvnricolywfszwdtqod/Build/Products/Debug-iphonesimulator/CTAssetsPickerController.bundle: bundle format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1
2.解决方案
最终定位到是升级系统后,缺少苹果官方证书(2030年2月20日过期版本证书),于是从其他人电脑导出后,安装上完美解决问题!!!
证书下载地址:链接:https://pan.baidu.com/s/1xkLwjUZ_vKOU8vd0xnXMpg 密码:v3jk
下载后安装,看到钥匙串中有该证书就可以了
为了保险,建议重启xcode,然后clean,之后再重新运行~