ipa包重签名

如果ipa打包时,签名文件不包括你的设备id,用itunes安装后是无法使用的,
这样,就要重新申请包含你设备id的证书,用下面的方法重签名:

1、把ipa和新证书放到同一目录下

2、新建文件resignipa.sh

IPA="xx.ipa"
IPAOUT="xxx.ipa"
PROVISION="xxxx.mobileprovision"
CERTIFICATE="xxxxx" # must be in keychain

# unzip the ipa
unzip -q "$IPA"

# remove the signature
rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources

# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision

# sign with the new certificate
/usr/bin/codesign -f -s "$CERTIFICATE" --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app

# zip it back up
zip -qr "$IPAOUT" Payload

3、启动命令行

chmod 777 resignipa.sh
./resignipa.sh

Leave a Reply

Your email address will not be published. Required fields are marked *

*