$ brew tap tungdev1209/xcode-ci
$ brew install xcode-ci
Initialize
$ cd path/to/ios/project
$ xcode-ci init
Ex:
$ cd /Users/tungdev1209/Projects/iOS/HelloWorld
$ xcode-ci init
Adjust default value
After initialized, .ci dir is created automatically, then you have to adjust params in both deploy_config.json and export_config.plist (ignore this file if you don't want to export)
init [-f/--force] : Initialize ci components (-f force re-init)
-b/--build 'build args' : Additional Build command arguments (plus build_args value in deploy_config.json in order to make final Build command)
-t/--test 'test args' : Additional Test command arguments (plus test_args value in deploy_config.json in order to make final Test command)
-a/--archive 'archive args' : Additional Archive command arguments (plus archive_args value in deploy_config.json in order to make final Archive command)
-e/--export 'export args' : Additional Export command arguments (plus export_args value in deploy_config.json in order to make final Export command)
-fw/--framework 'u.d.s' : Indicate this is the framework project, 'u' if you just want to export Universal framework, 'd' => Device framework and 's' => Simulator framework, 'u.d' if you would both Universal & Device frameworks. Default: export all kind of frameworks if you just -fw, if you don't -fw, xcode-ci understand this is normal application project
-r/--run 'b.t.a.e' : Indicate whether ci process will be run or not, 'b' if you just want to run Build process, 't' => Test process, 'a' => Archive process and 'e' => Export process, 'a.e' if you would like to run Archive and then Export process. Default: run all kind of processes one by one (Build -> Test -> Archive -> Export) if you don't type -r
-v/--version : show the version
Default arguments
By default, xcode-ci detect current type of project you would like to build (whether project or workspace) by project_name value (whether .xcodeproj or .xcworkspace) in deploy_config.json in order to make final Build command
Export : -exportArchive -archivePath archive_path/archive_scheme.xcarchive -exportOptionsPlist ./.ci/export_config.plist -exportPath archive_path/export_path (export_path: auto generate each time xcode-ci run Export process)
You could override above args via deploy_config.json and xcode-ci command
Hooks
$ xcode-ci
Above command means: xcode-ci will run all of the processes one by one (Build -> Test -> Archive -> Export) with config files (deploy_config.json and export_config.plist). Before and after each process, xcode-ci allow you add more processes you would like to run via ./hooks file
pre_build.sh
pre_test.sh
post_build.sh
post_test.sh
pre_archive.sh
post_archive.sh
pre_export.sh
post_export.sh
Example:
'The right example is worth 1000 lines of documentation'. I belive it!
=> For normal project:
$ xcode-ci -r 'b'
=> For framework project:
$ xcode-ci -fw 'u.d' -r 'a.e'
License
This project is licensed under the terms of the MIT license.
请发表评论