Mac系统升级后开发者证书不被信任,报错/usr/bin/codesign --force --sign

 

自己和同事升级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,之后再重新运行~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值