如何使用xcodebuild -exportArchive(Xcode8.3,自动签名)获取分发应用程序?

lai*_*lai 13 xcodebuild ios xcode8

经过更新Xcode8.3,选项' -exportSigningIdentity ', ' -exportProvisioningProfile '和' -exportFormat '从删除' xcodebuild联编-exportArchive '.

当我尝试获取分发应用程序时,我收到以下错误:
xcodebuild:错误:无效选项'-exportProvisioningProfile'.

那么当项目设置启用自动签名时,如何从MyApp.xcarchive获取分发MyApp.ipa?

自动签名

Sve*_*ker 24

听起来您想要从现有的xcarchive在命令行上创建IPA.从Xcode 7开始,执行此操作的首选方法是(from man xcodebuild):

xcodebuild -exportArchive -archivePath xcarchivepath -exportPath destinationpath -exportOptionsPlist path
Run Code Online (Sandbox Code Playgroud)

所以在你的情况下:

xcodebuild -exportArchive -archivePath MyApp.xcarchive -exportPath MyApp.ipa -exportOptionsPlist exportOptions.plist
Run Code Online (Sandbox Code Playgroud)

exportOptions.plist是一个PLIST文件,其中包含配置IPA导出的各种参数.请参阅xcodebuild -help所有可用选项.您必须至少指定一个条目method(app-store,ad-hoc,enterprise等 - 默认为开发).如果您只想导出App-Store分发,该文件应如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>app-store</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)