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.
坑终于踩完了