系统: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