git地址:https://github.com/FIRHQ/fir-cli
fir-cli 使用 Ruby 構(gòu)建, 無需編譯, 只要安裝相應(yīng) gem 即可.
$ ruby -v# > 1.9.3$ gem install fir-cli
備注:
Mac OS X 10.11 以后的版本, 由于10.11引入了rootless, 無法直接安裝 fir-cli, 有以下三種解決辦法:
1. 使用Homebrew及RVM安裝 Ruby, 再安裝 fir-cli(推薦)
# Install Homebrew:$ ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"# Install RVM:$\curl -sSL https://get.rvm.io|bash -s stable --ruby$ gem install fir-cli
2. 指定 fir-cli 中 bin 文件的 PATH
$exportPATH=/usr/local/bin:$PATH;gem install -n /usr/local/bin fir-cli
3. 重寫 Ruby Gem 的 bindir
$echo'gem: --bindir /usr/local/bin'>>~/.gemrc$ gem install fir-cli
使用方法:
(1)查看命令:fir build_ipa —help
Options:
-B, [--branch=BRANCH]# Set branch if project is a git repo, the default is `master`
如果這是個git工程,設(shè)置工程文件分支名戒职,默認分支 master透乾;
-w, [--workspace], [--no-workspace]# true/false if build workspace
是否編譯workspace的工程 true/false
-S, [--scheme=SCHEME]# Set the scheme NAME if build workspace
如果選擇編譯workspace洪燥,設(shè)置scheme名
-C, [--configuration=CONFIGURATION]# Use the build configuration NAME for building each target
為編譯的target設(shè)置debug或者release環(huán)境
-d, [--destination=DESTINATION]# Set the destinationspecifier
設(shè)置最終說明
-t, [--target=TARGET]# Build the target specified by targetname
通過target名編譯具體某一個target
-f, [--profile=PROFILE]# Set the export provisioning profile
設(shè)置導(dǎo)出發(fā)布證書
-o, [--output=OUTPUT]# IPA output path, the default is: BUILD_DIR/fir_build_ipa
打包ipa文件導(dǎo)出的位置
-p, [--publish], [--no-publish]# true/false if publish to fir.im
設(shè)置是否發(fā)布到fir.im true/false
-Q, [--qrcode], [--no-qrcode]# Generate qrcode
生成二維碼
-s, [--short=SHORT]# Set custom short link if publish to fir.im
設(shè)置發(fā)布到fir.im,自己想設(shè)置的短連接
-n, [--name=NAME]# Set custom ipa name when builded
設(shè)置自己想設(shè)置的ipa名字
-c, [--changelog=CHANGELOG]# Set changelog if publish to fir.im
設(shè)置發(fā)布到fir.im的日志
-T, [--token=TOKEN]# User's API Token at fir.im
用戶fir.im的用戶token
-V, [--verbose], [--no-verbose]# Show verbose# Default: true
顯示版本市咆,默認顯示
例子:
編譯 project, 加上 changelog, 并發(fā)布到 fir.im 上并生成二維碼圖片
fir build_ipa path/to/project -o path/to/output -p -C Release -c "This is changelog" -Q -T YOUR_API_TOKEN
fir build_ipa /Users/charleswang/Programs/Source_Tree_3.2.5_master -o /Users/charleswang/Programs -p -C Release -c "This is changelog" -Q -T 1aeee9a7530434c46e212892722b2fac