xcode8 自動打包 xcodebuild

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是一個目錄 會自動創(chuàng)建 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.

坑終于踩完了

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容