1、cd 进入工程目录
2、执行
xcodebuild -scheme supereye_unicom archive -archivePath /Users/freelancer/Desktop/supereye_unicom.xcarchive
* -scheme: 工程scheme名称
*-archivePath: 生成.xcarchive文件的存放目录
3、导出ipa
xcodebuild -exportArchive -exportFormat ipa \
-archivePath "/Users/freelancer/Desktop/supereye_unicom.xcarchive" \
-exportPath "/Users/freelancer/Desktop/supereye_unicom.ipa" \
-exportProvisioningProfile "supereye"
*-archivePath: .xcarchive文件绝对路径
*-exportPath:导出ipa的存放路径及ipa保存的文件名称
*-exportProvisioningProfile:iOS Provisioning profile文件名
附:xcodebuild用法参考https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html