$ xcodebuild --help
-parallelizeTargets build independent targets in parallel
-jobs NUMBER specify the maximum number of concurrent build operations
-maximum-concurrent-test-device-destinations NUMBER the maximum number of device destinations to test on concurrently
-maximum-concurrent-test-simulator-destinations NUMBER the maximum number of simulator destinations to test on concurrently
-parallel-testing-enabled YES|NO overrides the per-target setting in the scheme
-parallel-testing-worker-count NUMBER the exact number of test runners that will be spawned during parallel testing
-maximum-parallel-testing-workers NUMBER the maximum number of test runners that will be spawned during parallel testing
$ man xcodebuild
查看xcodebuild
所有用法
指定workspace
.
必须和“-scheme”一起使用,构建该workspace下的一个scheme。
指定project
.
当根目录下有多个project的时候,必须使用“-project”指定project,
指定target
指定scheme. 和“-workspace”一起使用,指定构建的scheme。
列出可用的SDK
$ xcodebuild -showsdks
设置SDK
-sdk iphoneos9.2
列出所有可用的Targets
、Build Configurations
、Schemes
// 列出默认Project的
$ xcodebuild -list
// 列出指定workspace的
$ xcodebuild -list -workspace <NAME>.xcworkspace/
编译的方式,Release,Debug,Adhoc 等
generic/platform=iOS
ONLY_ACTIVE_ARCH=NO
显示编译时间
是否开启单元测试并行执行
开启并发编译无依赖的目标
并发编译数
- clean:清除build目录下的
- build: 编译
- test: 测试某个scheme,必须和"-scheme"一起使用
- archive:打包,必须和“-scheme”一起使用
用到的scheme都要设置成share
$ xcodebuild -workspace ${WORKSPACE_NAME}.xcworkspace -scheme ${SCHEME_NAME} -sdk ${SDK_VERSION} -configuration ${CONFIGURATION} ONLY_ACTIVE_ARCH=NO build
$ xcodebuild -workspace ${WORKSPACE_NAME}.xcworkspace -scheme ${SCHEME_NAME} -sdk ${SDK_VERSION} -configuration ${CONFIGURATION} ONLY_ACTIVE_ARCH=NO clean
导出.xcarchive该文件
$ xcodebuild -workspace ${WORKSPACE_NAME}.xcworkspace -scheme ${SCHEME_NAME} -sdk ${SDK_VERSION} -configuration ${CONFIGURATION} -destination ${ARCHIVE_DESTINATION} -archivePath ${APP_DIR}/${APP_NAME}.xcarchive ONLY_ACTIVE_ARCH=NO archive
导出ipa文件
描述该文件名称,描述该文件<key>Name</key>
对应的值
plist文件路径。
$ xcodebuild --help
plist文件参数
$ TIMESTAMP=`date "+%Y_%m_%d_%H_%M_%S"`
$ IPA_PATH_NO_SUFFIX=${APP_DIR}/${APP_NAME}_${TIMESTAMP}
$ xcodebuild -exportArchive -archivePath ${APP_DIR}/${APP_NAME}.xcarchive -exportPath ${IPA_PATH_NO_SUFFIX} -exportProvisioningProfile "${PROFILE_NAME}" -exportFormat ipa -verbose
https://github.com/FIRHQ/fir-cli/blob/master/README.md
$ ruby -v # > 1.9.3
$ gem install fir-cli
fir publish ${IPA_PATH_NO_SUFFIX}.ipa -T ${FIR_TOKEN} || failed "fir publish"
** ARCHIVE FAILED **
The following build commands failed:
CompileC ***** normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
直接用Archive
:Xode
> Product
> Archive
,可以提示具体的代码错误。
- xcodebuild's new exportOptionsPlist flag
- 构建iOS持续集成平台(一)——自动化构建和依赖管理
- xcodebuild详细的命令行
- 使用 xcodebuild 从 archive 导出 ipa
- http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
- https://fir.im/
- http://blog.reohou.com/how-to-export-ipa-from-archive-using-xcodebuild/
- http://www.tuicool.com/articles/FBbmEn
- http://magicalboy.com/xcodebuild-usage/