如何重新签名ipa文件? [英] How to re-sign the ipa file?
问题描述
在使用不同的配置文件生成如下的IPA后,如何使用配置文件签署.ipa文件?我想在IPA上签署一个用于beta测试的临时配置文件,然后使用应用商店的应用提交配置文件重新签署确切的IPA。
How do I sign the .ipa file with a provisioning profile after I generate an IPA like the following with a different provision profile? I would like to sign the IPA with an ad-hoc provisioning profile for beta testing, and then re-sign the exact IPA with an app submission provisioning profile for the app store.
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${RELEASE_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}"
推荐答案
从命令行执行起来非常简单。为了做到这一点,我有一个脚本的要点。现已将其合并到 https://github.com/RichardBronosky/ota-tools的ipa_sign脚本中我每天都用的。如果您对使用这些工具有任何疑问,请不要犹豫。
It's really easy to do from the command line. I had a gist of a script for doing this. It has now been incorporated into the ipa_sign script in https://github.com/RichardBronosky/ota-tools which I use daily. If you have any questions about using these tools, don't hesitate to ask.
它的核心是:
IPA="/path/to/file.ipa"
PROVISION="/path/to/file.mobileprovision"
CERTIFICATE="Name of certificate: To sign with" # must be in keychain
# unzip the ipa
unzip -q "$IPA"
# remove the signature
rm -rf Payload/*.app/_CodeSignature
# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
# sign with the new certificate (--resource-rules has been deprecated OS X Yosemite (10.10), it can safely be removed)
/usr/bin/codesign -f -s "$CERTIFICATE" --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app
# zip it back up
zip -qr resigned.ipa Payload
您的新签名应用程序名为resigned.ipa
Your new signed app is called resigned.ipa
这篇关于如何重新签名ipa文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!