Xcode 8.3之前
先編譯
xcodebuild -workspace $scheme_name.xcworkspace -scheme $scheme_name -configuration $build_model
生成ipa
xcrun -sdk iphoneos -v PackageApplication ${app_path} -o ${ipa_path}
Xcode8.3 開始不支持PackageApplication命令了
生成 archive
xcodebuild archive -workspace ${work_path} -scheme ${scheme_name} -configuration build_model -archivePath ${archive_path}
導出
xcodebuild -exportArchive -exportOptionsPlist ${plist_path} -archivePath ${archive_path} -exportPath ${ipa_path}
生成之后可以 上傳到fir
fir publish ${ipa_file_path} -T $fir_token -c "$fir_log" -Q -q
ipa_file_path: 完整ipa路徑
ipa_path是一個目錄 會自動創建 scheme_name.ipa 后面的信息不用添加
plist 模板
<?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>teamID</key>
<string>MYTEAMID123</string>
<key>method</key>
<string>app-store</string>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>
method四種方式 等.
method: (String) The method of distribution, which can be set as any of the following:
app-store
enterprise
ad-hoc
development
teamID: (String) The development program team identifier.
uploadSymbols: (Boolean) Option to include symbols in the generated ipa file.
uploadBitcode: (Boolean) Option to include Bitcode.
坑終于踩完了