1.cd 项目根目录
2.清除编译过程生成的文件
xcodebuild clean -project 项目名.xcodeproj -scheme 项目名 -configuration Debug
xcodebuild clean -project 项目名.xcodeproj -scheme 项目名 -configuration Release
3.使用archive命令生成.xcarchive文件
xcodebuild archive -workspace 项目名.xcworkspace -scheme 项目名 -archivePath ./项目名.xcarchive
4.创建配置文件
在项目根目录下新建一个plist文件,包的导出方式取决于这个配置文件
Developer

app-Store

ADHoc

5.导出包
xcodebuild -exportArchive -exportOptionsPlist 配置文件的名字.plist -archivePath ./项目名.xcarchive -exportPath 导出包存储路径 -allowProvisioningUpdates
网友评论