xcode9之后的打包方式
XCode8.3之前的打包
https://github.com/webfrogs/xcode_shell/blob/master/ipa-build
阅读链接上的这个脚本, 可以理解构建三部曲为:
- Clean build cache
- 编译出.archive
- xcrun打包为.ipa文件
第三步是和XCode9差异最大的地方, 先记住这里:

XCode9之后的打包
听说是8.3之后就不一样的了.
细化上面的三个步骤为:
Clean Build Cache:
1
xcodebuild clean -workspace $workspace -scheme $scheme -configuration $configuration
与xcode8无任何差异.
编译,生成.xcarchive
xcodebuild archive -workspace $workspace -scheme $scheme -configuration
\ $configuration -archivePath $archivePath -destination generic/platform=ios
\ CODE_SIGN_IDENTITY="$code_sign_indentity"
这里可以不需要这个参数, CODE_SIGN_IDENTITY="$code_sign_indentity".
将.xcarchive生成.IPA
xcodebuild -exportArchive -archivePath $archivePath
\ -exportPath $exportPath -destination generic/platform=ios
\ -exportOptionsPlist $exportOptionPlist -allowProvisioningUpdates
这一步有特殊的地方, 就是-exportOptionsPlist $exportOptionPlist, 它的格式如下, 做了下扼要的说明, 官网能找到它的说明文档:






