#证书名称
CERTIFICATE=$"iPhone Developer: XXXX"
#app的路径
ORIGINAL_FILE=$"/Users/yuxiaoguang/Desktop/Payload/apple.app"
#回到Payload路径
cd $ORIGINAL_FILE
cd ..
cd ..
echo '*** 生成t_entitlements.plist ***'
security cms -D -i "$ORIGINAL_FILE/embedded.mobileprovision" > t_entitlements_full.plist
/usr/libexec/PlistBuddy -x -c 'Print:Entitlements' t_entitlements_full.plist > t_entitlements.plist
echo '*** framework重签名 ***'
codesign -f -s "$CERTIFICATE" $ORIGINAL_FILE/Frameworks/AggregateKitCore.framework
echo '*** app重签名 ***'
codesign -f -s "$CERTIFICATE" $ORIGINAL_FILE/ --entitlements t_entitlements.plist
echo '*** 压缩成ipa文件 ***'
echo 'zxcv'|sudo -S zip -qr resign.ipa ./Payload
其中CERTIFICATE是证书名字,ORIGINAL_FILE是路径,'zxcv'是电脑密码
对于路径的命令搞不懂,所以写得有点糟糕,欢迎指正。