Joh*_*nny 104 ios ipa ios-provisioning
在使用不同的配置文件生成如下所示的IPA后,如何使用配置文件签署.ipa文件?我想在IPA上签署一个用于beta测试的临时配置文件,然后使用应用商店的应用提交配置文件重新签署确切的IPA.
/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}"
Run Code Online (Sandbox Code Playgroud)
Bru*_*sky 191
从命令行执行起来非常简单.为了做到这一点,我有一个脚本的要点.它现在已经被整合到我每天使用的https://github.com/RichardBronosky/ota-tools中的ipa_sign脚本中.如果您对使用这些工具有任何疑问,请随时提出.
它的核心是:
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" Payload/*.app
# zip it back up
zip -qr resigned.ipa Payload
Run Code Online (Sandbox Code Playgroud)
您新签名的应用程序名为resigned.ipa
Lor*_*rdT 36
检查iResign以获取有关如何执行此操作的简单工具!
[编辑]经过一番骚动后,我找到了一个解决钥匙串意识的问题.您可以访问https://gist.github.com/Weptun/5406993查看
Bry*_*anH 13
有点老问题,但使用最新的XCode,codesign很容易:
$ codesign -s my_certificate example.ipa
$ codesign -vv example.ipa
example.ipa: valid on disk
example.ipa: satisfies its Designated Requirement
Run Code Online (Sandbox Code Playgroud)
这里发布的答案对我来说都不太合适.他们主要跳过签署嵌入式框架(或包括权利).
这是什么对我有用(它假设存在一个ipa文件在当前目录中):
PROVISION="/path/to/file.mobileprovision"
CERTIFICATE="Name of certificate: To sign with" # must be in the keychain
unzip -q *.ipa
rm -rf Payload/*.app/_CodeSignature/
# Replace embedded provisioning profile
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
# Extract entitlements from app
codesign -d --entitlements :entitlements.plist Payload/*.app/
# Re-sign embedded frameworks
codesign -f -s "$CERTIFICATE" --entitlements entitlements.plist Payload/*.app/Frameworks/*
# Re-sign the app (with entitlements)
codesign -f -s "$CERTIFICATE" --entitlements entitlements.plist Payload/*.app/
zip -qr resigned.ipa Payload
# Cleanup
rm entitlements.plist
rm -r Payload/
Run Code Online (Sandbox Code Playgroud)
Fastlane的叹息为辞职IPA提供了相当强大的解决方案.
从他们的自述文件:
辞职
如果您生成了
ipa文件但想要将不同的代码签名应用到ipa文件,则可以使用sigh resign:
fastlane sigh resign
sigh如果它们位于当前文件夹中,将为您找到ipa文件和配置文件.您可以使用命令行传递更多信息:
fastlane sigh resign ./path/app.ipa --signing_identity "iPhone Distribution: Felix Krause" -p "my.mobileprovision"
它甚至可以处理嵌套应用程序的配置文件(例如,如果你有watchkit应用程序)
我更新了Bryan的Sierra iMac代码:
# this version was tested OK vith macOs Sierra 10.12.5 (16F73) on oct 0th, 2017
# original ipa file must be store in current working directory
IPA="ipa-filename.ipa"
PROVISION="path-to.mobileprovision"
CERTIFICATE="hexadecimal-certificate-identifier" # must be in keychain
# identifier maybe retrieved by running: security find-identity -v -p codesigning
# unzip the ipa
unzip -q "$IPA"
# remove the signature
rm -rf Payload/*.app/_CodeSignature
# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
# generate entitlements for current app
cd Payload/
codesign -d --entitlements - *.app > entitlements.plist
cd ..
mv Payload/entitlements.plist entitlements.plist
# sign with the new certificate and entitlements
/usr/bin/codesign -f -s "$CERTIFICATE" '--entitlements' 'entitlements.plist' Payload/*.app
# zip it back up
zip -qr resigned.ipa Payload
Run Code Online (Sandbox Code Playgroud)
_CodeSigned夹embedded.mobileprovision新的配置文件替换文件执行以下命令:
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --resource-rules "Payload/Application.app/ResourceRules.plist" "Payload/Application.app"
现在再次压缩Payload文件夹,并使用.ipa更改.zip扩展名
希望对您有所帮助。
供参考,请参见下面提到的链接:http : //www.modelmetrics.com/tomgersic/codesign-re-signing-an-ipa-between-apple-accounts/
它应该可以帮助您退出 IPA 文件。我自己尝试过,但无法通过 Entitlements.plist 传递错误。可能只是我的项目有问题。你应该尝试一下。
| 归档时间: |
|
| 查看次数: |
136143 次 |
| 最近记录: |