系統:macOS Mojave 10.14.1
xcode:Version 10.0 (10A255)
打包命令:xcodebuild
命令格式使用 xcodebuild -help 查詢
1.clean
xcodebuild clean -project xxx.xcodeproj -configuration Release -alltargets
2.archive
xcodebuild archive -project xxx.xcodeproj -sdk iphoneos -scheme scheme_name -configuration Release -archivePath archive_path
3.export
xcodebuild -exportArchive -archivePath archive_path -exportPath export_path -exportOptionsPlist exportOptionsPlist
紅色部分爲必須替換的內容,根據各自工程設置填寫,綠色可選修改,簽名和profile信息主要在 exportOptionsPlist 指定的plist文件裏,這個 plist 文件不會添的話可以從 xcode 導出目錄拷貝,使用 xcode archive 之後,導出 distribute app,導出的時候只要正確選則號簽名和 profile 就可以導出了,導出目錄裏有個 ExportOptions.plist 文件,這個就是 exportOptionsPlist。一般導出發佈app store的版本和可以安裝到指定設備上的 development 版本,這個指定設備需要在ios開發後臺創建許可證的地方添加。
exportOptionsPlist 主要指定參數,參數內容均可在 xcodebuild -help 中查詢到範本:
<key>provisioningProfiles</key>
<dict>
<key>包名 bundle ID</key>
<string>Profile的uuid</string>
</dict>
<key>signingCertificate</key>
<string>證書</string>
<key>teamID</key>
<string>開發者ID</string>
<key>method</key>
<string>導出方式(app-store 或 development)</string>
參考:
iOS自動簽名打包(xcodebuild):https://www.jianshu.com/p/722adedaa3bf
上面這個的git地址:https://github.com/qindeli/NoWorkspaceShell/blob/master/xcodebuild.sh
xcode APP 打包以及提交apple審覈詳細流程(新版本更新提交審覈):https://blog.csdn.net/mad1989/article/details/8167529
Xcode9 xcodebuild export plist 配置:https://blog.csdn.net/andanlan/article/details/78113330?locationNum=9&fps=1