Apple官方文档《BSD General Commands Manual XCODEBUILD(1)》,很详细介绍了“xcodebuild”命令和参数,请耐心读几遍!
以下是实例:
(1)清除
xcodebuild clean -project ./Documents/MyApp/MyApp.xcodeproj -configuration ${CONFIGURATION} -alltargets
(2)构建
xcodebuild archive -project ./Documents/MyApp/MyApp.xcodeproj -scheme MyApp -archivePath bin/MyApp.xcarchive
(3)打包
xcodebuild -exportArchive -archivePath bin/MyApp.xcarchive -exportPath MyApp -exportFormat ipa -exportProvisioningProfile “My App Provisioning Profile Name”