fir-cli 1.4.8 → 1.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/CHANGELOG +3 -0
- data/README.md +12 -224
- data/doc/build_apk.md +42 -0
- data/doc/build_ipa.md +57 -0
- data/doc/help.md +34 -0
- data/doc/info.md +44 -0
- data/doc/install.md +65 -0
- data/doc/login.md +19 -0
- data/doc/mapping.md +22 -0
- data/doc/publish.md +36 -0
- data/doc/upgrade.md +7 -0
- data/fir-cli.gemspec +1 -1
- data/lib/fir/util/publish.rb +1 -1
- data/lib/fir/version.rb +1 -1
- data/test/publish_test.rb +15 -2
- metadata +12 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90ae72f438cf6fd7875108bf55144186b7e1184c
|
4
|
+
data.tar.gz: d3f2953c56f666afa334469784324953c90b3c96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39166292c62f7f4cb9b619953097757fd8283750c506530369dacc59e535eafe8401b192393424e603927c231f30404ad579646c13ff6c10101c017b7ee2f3de
|
7
|
+
data.tar.gz: 8694694118ab6973cc8049d9a8fdac632743ec64a9822828baa086b010ee48d22333c90f6888a50dce94c2ec47576f11753db4660c62b3e716909da22c753d45
|
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -6,236 +6,23 @@
|
|
6
6
|
[![Test Coverage](https://codeclimate.com/github/FIRHQ/fir-cli/badges/coverage.svg)](https://codeclimate.com/github/FIRHQ/fir-cli/coverage)
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/fir-cli.svg)](http://badge.fury.io/rb/fir-cli)
|
8
8
|
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/FIRHQ/fir-cli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
9
|
+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/FIRHQ/fir-cli/master/LICENSE.txt)
|
9
10
|
|
10
11
|
fir.im-cli 可以通过指令查看, 上传, 编译 iOS/Android 应用.
|
11
12
|
|
12
13
|
![fir-cli](http://7rf35s.com1.z0.glb.clouddn.com/fir-cli-new.gif)
|
13
14
|
|
14
|
-
##
|
15
|
+
## 文档
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
```sh
|
27
|
-
$ gem install fir-cli
|
28
|
-
```
|
29
|
-
|
30
|
-
**注意: 如果你的系统是 Mac OS X 10.11 以后的版本, 由于10.11引入了 `rootless`, 无法直接安装 fir-cli, 有以下三种解决办法:**
|
31
|
-
|
32
|
-
1\. 使用 [Homebrew](http://brew.sh/) 及 [RVM](https://rvm.io/) 安装 Ruby, 再安装 fir-cli(推荐)
|
33
|
-
|
34
|
-
```sh
|
35
|
-
# Install Homebrew:
|
36
|
-
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
37
|
-
|
38
|
-
# Install RVM:
|
39
|
-
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby
|
40
|
-
|
41
|
-
$ gem install fir-cli
|
42
|
-
```
|
43
|
-
|
44
|
-
2\. 指定 fir-cli 中 bin 文件的 PATH
|
45
|
-
|
46
|
-
```sh
|
47
|
-
$ export PATH=/usr/local/bin:$PATH;gem install -n /usr/local/bin fir-cli
|
48
|
-
```
|
49
|
-
|
50
|
-
3\. 重写 Ruby Gem 的 bindir
|
51
|
-
|
52
|
-
```sh
|
53
|
-
$ echo 'gem: --bindir /usr/local/bin' >> ~/.gemrc
|
54
|
-
$ gem install fir-cli
|
55
|
-
```
|
56
|
-
|
57
|
-
### Linux 安装
|
58
|
-
|
59
|
-
需要提前安装好 Ruby 版本 > 1.9.3
|
60
|
-
|
61
|
-
```sh
|
62
|
-
$ gem install fir-cli
|
63
|
-
```
|
64
|
-
|
65
|
-
**注意: 如果出现 `ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)` 的错误, 请先更换 Ruby 的淘宝源(由于国内网络原因, 你懂的), 并升级下系统自带的 gem**
|
66
|
-
|
67
|
-
```sh
|
68
|
-
$ gem sources --remove https://rubygems.org/
|
69
|
-
$ gem sources -a https://ruby.taobao.org/
|
70
|
-
$ gem sources -l
|
71
|
-
*** CURRENT SOURCES ***
|
72
|
-
|
73
|
-
https://ruby.taobao.org
|
74
|
-
# 请确保只有 ruby.taobao.org, 如果有其他的源, 请 remove 掉
|
75
|
-
|
76
|
-
gem update --system
|
77
|
-
gem install fir-cli
|
78
|
-
```
|
79
|
-
|
80
|
-
## 使用说明
|
81
|
-
|
82
|
-
### fir help 使用说明
|
83
|
-
|
84
|
-
`fir help` 命令不仅可以运行在 `fir` 主命令上, 还可以运行在相应子命令上查看相关的帮助
|
85
|
-
|
86
|
-
```sh
|
87
|
-
$ fir help
|
88
|
-
Commands:
|
89
|
-
fir build_apk BUILD_DIR # Build Android app (alias: `ba`).
|
90
|
-
fir build_ipa BUILD_DIR [options] [settings] # Build iOS app (alias: `bi`).
|
91
|
-
fir help # Describe available commands or one specific command (aliases: `h`).
|
92
|
-
fir info APP_FILE_PATH # Show iOS/Android app info, support ipa/apk file (aliases: `i`).
|
93
|
-
fir login # Login fir.im (aliases: `l`).
|
94
|
-
fir mapping MAPPING_FILE_PATH # Upload app mapping file to BugHD.com (aliases: `m`).
|
95
|
-
fir me # Show current user info if user is logined.
|
96
|
-
fir publish APP_FILE_PATH # Publish iOS/Android app to fir.im, support ipa/apk file (aliases: `...
|
97
|
-
fir upgrade # Upgrade fir-cli and quit (aliases: `u`).
|
98
|
-
fir version # Show fir-cli version number and quit (aliases: `v`).
|
99
|
-
|
100
|
-
Options:
|
101
|
-
-T, [--token=TOKEN] # User's API Token at fir.im
|
102
|
-
-L, [--logfile=LOGFILE] # Path to writable logfile
|
103
|
-
-V, [--verbose], [--no-verbose] # Show verbose
|
104
|
-
# Default: true
|
105
|
-
-q, [--quiet], [--no-quiet] # Silence commands
|
106
|
-
-h, [--help], [--no-help] # Show this help message and quit
|
107
|
-
```
|
108
|
-
#### 全局参数说明
|
109
|
-
|
110
|
-
- `alias <short command>` 意味着可以用 alias 别名来代替该指令, 例如 `fir b`
|
111
|
-
- `-T` 用户在 fir.im 上的 api_token
|
112
|
-
- `-L` 指定 fir-cli 的输出 log, 默认为 STDOUT
|
113
|
-
- `-V` Verbose, 默认为输出所有信息( INFO 和 ERROR), 如果设置 `--no-verbose`, 则只输出 ERROR 信息
|
114
|
-
- `-q` 静默模式, 默认关闭
|
115
|
-
- `-h` 查看相关命令帮助
|
116
|
-
|
117
|
-
### fir publish 使用说明
|
118
|
-
|
119
|
-
fir publish 命令可以轻松发布应用到 fir.im, 支持 ipa 和 apk 文件.
|
120
|
-
|
121
|
-
```sh
|
122
|
-
$ fir publish path/to/application -T YOUR_FIR_TOKEN
|
123
|
-
```
|
124
|
-
|
125
|
-
如果需要上传 changelog, 自定义 short 地址, 设置密码, 设置公开访问权限, 上传符号表, 生成二维码等功能, 可以使用 `fir publish -h`查看相应的帮助
|
126
|
-
|
127
|
-
### fir login 使用说明
|
128
|
-
|
129
|
-
如果觉得每次上传都输入 `-T` 很不方便, 那么可使用 `login` 命令
|
130
|
-
|
131
|
-
```sh
|
132
|
-
$ fir login
|
133
|
-
```
|
134
|
-
|
135
|
-
这时系统会提示输入用户 API token, 用户的 API token 可在 **[这里](http://fir.im/apps/apitoken)** 的右上角查看
|
136
|
-
|
137
|
-
```sh
|
138
|
-
Please enter your fir.im API Token:
|
139
|
-
I, [2015-08-26T10:10:28.235295 #6833] INFO -- : Login succeed, previous user's email: xxx@xxx.com
|
140
|
-
I, [2015-08-26T10:10:28.245083 #6833] INFO -- : Login succeed, current user's email: xxx@xxx.com
|
141
|
-
I, [2015-08-26T10:10:28.245152 #6833] INFO -- :
|
142
|
-
```
|
143
|
-
|
144
|
-
### fir build 使用说明
|
145
|
-
|
146
|
-
该指令分为两个不同的指令, `build_ipa` 和 `build_apk`, 可以编译 ipa 及 apk 应用并上传到 fir.im
|
147
|
-
|
148
|
-
#### 编译 ipa
|
149
|
-
|
150
|
-
`build_ipa` 对 `xcodebuild` 原生指令进行了封装, 将常用的参数名简化, 支持全部的自带参数及设置, 同时输出符号表 dSYM 文件.
|
151
|
-
|
152
|
-
编译 project
|
153
|
-
|
154
|
-
```
|
155
|
-
$ fir build_ipa path/to/project -o path/to/output
|
156
|
-
```
|
157
|
-
|
158
|
-
编译 workspace
|
159
|
-
|
160
|
-
```sh
|
161
|
-
$ fir build_ipa path/to/workspace -o path/to/output -w -C Release -t allTargets GCC_PREPROCESSOR_DEFINITIONS="FOO=bar"
|
162
|
-
```
|
163
|
-
|
164
|
-
该指令在指向的目录中,找到第一个 workspace 文件,对其进行编译。使用 `Release` 设置,编译策略为 `allTargets`,同时设置了预编译参数 `FOO`。
|
165
|
-
|
166
|
-
编译用 CocoaPods 做依赖管理的 .ipa 包
|
167
|
-
|
168
|
-
```sh
|
169
|
-
$ fir build_ipa path/to/workspace -w -S <scheme name>
|
170
|
-
```
|
171
|
-
|
172
|
-
#### 编译用 Gradle 打包 apk
|
173
|
-
|
174
|
-
```sh
|
175
|
-
# 简单打包
|
176
|
-
$ fir build_apk path/to/project
|
177
|
-
|
178
|
-
# 打包并上传
|
179
|
-
$ fir ba <project dir> [-o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
180
|
-
|
181
|
-
# 打包指定的 flavor
|
182
|
-
$ fir ba <project dir> [-f <flavor> -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
183
|
-
|
184
|
-
# 打包指定的 git branch
|
185
|
-
$ fir ba <git ssh url> [-B develop -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
186
|
-
```
|
187
|
-
|
188
|
-
#### 编译并且上传至 fir.im
|
189
|
-
|
190
|
-
只需要输入 `-p -T` 即可
|
191
|
-
|
192
|
-
```sh
|
193
|
-
$ fir build_ipa/build_apk path/to/project -o path/to/output -p -T YOUR_FIR_TOKEN -c YOUR_CHANGELOG
|
194
|
-
```
|
195
|
-
|
196
|
-
如果需要更详细的使用说明, 可以使用 `fir build_ipa/build_apk -h`查看相应的帮助
|
197
|
-
|
198
|
-
### fir mapping 使用说明
|
199
|
-
|
200
|
-
该指令可以上传符号表至 [BugHD.com](http://bughd.com) 所对应的项目, 目前已经支持 dSYM 和 txt 两种格式的符号表文件上传, 有以下三种方法上传:
|
201
|
-
|
202
|
-
> 指定 version 和 build 上传:
|
203
|
-
|
204
|
-
```sh
|
205
|
-
$ fir m <mapping file path> -P <bughd project id> -v <app version> -b <app build> -T <your api token>
|
206
|
-
```
|
207
|
-
|
208
|
-
> 在 publish 的时候自动上传:
|
209
|
-
|
210
|
-
```sh
|
211
|
-
$ fir p <app file path> -m <mapping file path> -P <bughd project id> -T <your api token>
|
212
|
-
```
|
213
|
-
> 在 build_ipa 的时候自动上传:
|
214
|
-
|
215
|
-
```sh
|
216
|
-
$ fir b <project dir> -P <bughd project id> -M -p -T <your api token>
|
217
|
-
```
|
218
|
-
|
219
|
-
如果需要更详细的使用说明, 可以使用 `fir mapping -h`查看相应的帮助
|
220
|
-
|
221
|
-
### fir me 使用说明
|
222
|
-
|
223
|
-
该指令可以查看当前使用者
|
224
|
-
|
225
|
-
```sh
|
226
|
-
$ fir me
|
227
|
-
I, [2015-11-02T03:03:04.933645 #29886] INFO -- : Login succeed, current user's email: xxxx
|
228
|
-
I, [2015-11-02T03:03:04.933756 #29886] INFO -- : Login succeed, current user's name: xxxx
|
229
|
-
I, [2015-11-02T03:03:04.933787 #29886] INFO -- :
|
230
|
-
```
|
231
|
-
|
232
|
-
### fir upgrade 使用说明
|
233
|
-
|
234
|
-
该指令用于升级最新版本的 fir-cli
|
235
|
-
|
236
|
-
```sh
|
237
|
-
$ fir upgrade
|
238
|
-
```
|
17
|
+
- [安装及常见安装问题](https://github.com/FIRHQ/fir-cli/blob/master/doc/install.md)
|
18
|
+
- [fir help 相关指令帮助](https://github.com/FIRHQ/fir-cli/blob/master/doc/help.md)
|
19
|
+
- [fir info 查看 ipa/apk 信息](https://github.com/FIRHQ/fir-cli/blob/master/doc/info.md)
|
20
|
+
- [fir login & fir me 登录相关](https://github.com/FIRHQ/fir-cli/blob/master/doc/login.md)
|
21
|
+
- [fir publish 发布应用到 fir.im](https://github.com/FIRHQ/fir-cli/blob/master/doc/publish.md)
|
22
|
+
- [fir build_ipa 编译打包 ipa 文件](https://github.com/FIRHQ/fir-cli/blob/master/doc/build_ipa.md)
|
23
|
+
- [fir build_apk 编译打包 apk 文件](https://github.com/FIRHQ/fir-cli/blob/master/doc/build_apk.md)
|
24
|
+
- [fir mapping 上传符号表至 BugHD.com](https://github.com/FIRHQ/fir-cli/blob/master/doc/mapping.md)
|
25
|
+
- [fir upgrade 升级相关](https://github.com/FIRHQ/fir-cli/blob/master/doc/upgrade.md)
|
239
26
|
|
240
27
|
## 提交反馈
|
241
28
|
|
@@ -247,3 +34,4 @@ $ fir upgrade
|
|
247
34
|
|
248
35
|
![](http://7rf35s.com1.z0.glb.clouddn.com/coffee.png)
|
249
36
|
|
37
|
+
|
data/doc/build_apk.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#### fir build_apk
|
2
|
+
|
3
|
+
`fir build_apk` 指令用于编译用 Gradle 打包 apk, 并且支持直接从 Github/Gitlab 相关 repo 直接编译打包.
|
4
|
+
|
5
|
+
```sh
|
6
|
+
fir build_apk --help
|
7
|
+
Usage:
|
8
|
+
fir build_apk BUILD_DIR
|
9
|
+
|
10
|
+
Options:
|
11
|
+
-B, [--branch=BRANCH] # Set branch if project is a git repo, the default is `master`
|
12
|
+
-o, [--output=OUTPUT] # APK output path, the default is: BUILD_DIR/build/outputs/apk
|
13
|
+
-p, [--publish], [--no-publish] # true/false if publish to fir.im
|
14
|
+
-f, [--flavor=FLAVOR] # Set flavor if have productFlavors
|
15
|
+
-s, [--short=SHORT] # Set custom short link if publish to fir.im
|
16
|
+
-n, [--name=NAME] # Set custom apk name when builded
|
17
|
+
-c, [--changelog=CHANGELOG] # Set changelog if publish to fir.im, support string/file
|
18
|
+
-Q, [--qrcode], [--no-qrcode] # Generate qrcode
|
19
|
+
[--open], [--no-open] # true/false if open for everyone, the default is: true
|
20
|
+
# Default: true
|
21
|
+
[--password=PASSWORD] # Set password for app
|
22
|
+
-T, [--token=TOKEN] # User's API Token at fir.im
|
23
|
+
-L, [--logfile=LOGFILE] # Path to writable logfile
|
24
|
+
-V, [--verbose], [--no-verbose] # Show verbose
|
25
|
+
# Default: true
|
26
|
+
-q, [--quiet], [--no-quiet] # Silence commands
|
27
|
+
-h, [--help], [--no-help] # Show this help message and quit
|
28
|
+
```
|
29
|
+
|
30
|
+
```sh
|
31
|
+
# 简单打包
|
32
|
+
$ fir build_apk path/to/project
|
33
|
+
|
34
|
+
# 打包并上传
|
35
|
+
$ fir ba <project dir> [-o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
36
|
+
|
37
|
+
# 打包指定的 flavor
|
38
|
+
$ fir ba <project dir> [-f <flavor> -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
39
|
+
|
40
|
+
# 打包指定的 git branch
|
41
|
+
$ fir ba <git ssh url> [-B develop -o <apk output dir> -c <changelog> -p -Q -T <your api token>]
|
42
|
+
```
|
data/doc/build_ipa.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
### fir build_ipa
|
2
|
+
|
3
|
+
`fir build_ipa` 对 `xcodebuild` 原生指令进行了封装, 将常用的参数名简化, 支持全部的自带参数及设置, 同时输出符号表 dSYM 文件, 并且支持直接从 Github/Gitlab 相关 repo 直接编译打包.
|
4
|
+
|
5
|
+
```sh
|
6
|
+
$ fir build_ipa --help
|
7
|
+
fir build_ipa --help
|
8
|
+
Usage:
|
9
|
+
fir build_ipa BUILD_DIR [options] [settings]
|
10
|
+
|
11
|
+
Options:
|
12
|
+
-B, [--branch=BRANCH] # Set branch if project is a git repo, the default is `master`
|
13
|
+
-w, [--workspace], [--no-workspace] # true/false if build workspace
|
14
|
+
-S, [--scheme=SCHEME] # Set the scheme NAME if build workspace
|
15
|
+
-C, [--configuration=CONFIGURATION] # Use the build configuration NAME for building each target
|
16
|
+
-d, [--destination=DESTINATION] # Set the destinationspecifier
|
17
|
+
-t, [--target=TARGET] # Build the target specified by targetname
|
18
|
+
-f, [--profile=PROFILE] # Set the export provisioning profile
|
19
|
+
-o, [--output=OUTPUT] # IPA output path, the default is: BUILD_DIR/fir_build_ipa
|
20
|
+
-p, [--publish], [--no-publish] # true/false if publish to fir.im
|
21
|
+
-s, [--short=SHORT] # Set custom short link if publish to fir.im
|
22
|
+
-n, [--name=NAME] # Set custom ipa name when builded
|
23
|
+
-c, [--changelog=CHANGELOG] # Set changelog if publish to fir.im
|
24
|
+
-Q, [--qrcode], [--no-qrcode] # Generate qrcode
|
25
|
+
-M, [--mapping], [--no-mapping] # true/false if upload app mapping file to BugHD.com
|
26
|
+
-P, [--proj=PROJ] # Project id in BugHD.com if upload app mapping file
|
27
|
+
[--open], [--no-open] # true/false if open for everyone, the default is: true
|
28
|
+
# Default: true
|
29
|
+
[--password=PASSWORD] # Set password for app
|
30
|
+
-T, [--token=TOKEN] # User's API Token at fir.im
|
31
|
+
-L, [--logfile=LOGFILE] # Path to writable logfile
|
32
|
+
-V, [--verbose], [--no-verbose] # Show verbose
|
33
|
+
# Default: true
|
34
|
+
-q, [--quiet], [--no-quiet] # Silence commands
|
35
|
+
-h, [--help], [--no-help] # Show this help message and quit
|
36
|
+
```
|
37
|
+
|
38
|
+
示例:
|
39
|
+
|
40
|
+
- 编译 project, 加上 changelog, 并发布到 fir.im 上并生成二维码图片
|
41
|
+
|
42
|
+
```
|
43
|
+
$ fir build_ipa path/to/project -o path/to/output -p -c "this is changelog" -Q -T YOUR_API_TOKEN
|
44
|
+
```
|
45
|
+
|
46
|
+
- 编译 Github 上的 workspace
|
47
|
+
|
48
|
+
```sh
|
49
|
+
$ fir build_ipa git@github.com:xxxx.git -o path/to/output -w -C Release -t allTargets GCC_PREPROCESSOR_DEFINITIONS="FOO=bar"
|
50
|
+
```
|
51
|
+
该指令在指向的目录中,找到第一个 workspace 文件, 对其进行编译. 使用 `Release` 设置,编译策略为 `allTargets`, 同时设置了预编译参数 `FOO`.
|
52
|
+
|
53
|
+
- 编译用 CocoaPods 做依赖管理的 .ipa 包
|
54
|
+
|
55
|
+
```sh
|
56
|
+
$ fir build_ipa path/to/workspace -w -S <scheme name>
|
57
|
+
```
|
data/doc/help.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
### 相关指令帮助
|
2
|
+
|
3
|
+
`fir help` 命令不仅可以运行在 `fir` 主命令上, 还可以运行在相应子命令上查看相关的帮助.
|
4
|
+
|
5
|
+
```sh
|
6
|
+
$ fir help
|
7
|
+
Commands:
|
8
|
+
fir build_apk BUILD_DIR # Build Android app (alias: `ba`).
|
9
|
+
fir build_ipa BUILD_DIR [options] [settings] # Build iOS app (alias: `bi`).
|
10
|
+
fir help # Describe available commands or one specific command (aliases: `h`).
|
11
|
+
fir info APP_FILE_PATH # Show iOS/Android app info, support ipa/apk file (aliases: `i`).
|
12
|
+
fir login # Login fir.im (aliases: `l`).
|
13
|
+
fir mapping MAPPING_FILE_PATH # Upload app mapping file to BugHD.com (aliases: `m`).
|
14
|
+
fir me # Show current user info if user is logined.
|
15
|
+
fir publish APP_FILE_PATH # Publish iOS/Android app to fir.im, support ipa/apk file (aliases: `...
|
16
|
+
fir upgrade # Upgrade fir-cli and quit (aliases: `u`).
|
17
|
+
fir version # Show fir-cli version number and quit (aliases: `v`).
|
18
|
+
|
19
|
+
Options:
|
20
|
+
-T, [--token=TOKEN] # User's API Token at fir.im
|
21
|
+
-L, [--logfile=LOGFILE] # Path to writable logfile
|
22
|
+
-V, [--verbose], [--no-verbose] # Show verbose
|
23
|
+
# Default: true
|
24
|
+
-q, [--quiet], [--no-quiet] # Silence commands
|
25
|
+
-h, [--help], [--no-help] # Show this help message and quit
|
26
|
+
```
|
27
|
+
#### 全局参数说明
|
28
|
+
|
29
|
+
- `alias <short command>` 意味着可以用 alias 别名来代替该指令, 例如 `fir b`
|
30
|
+
- `-T` 用户在 fir.im 上的 api_token
|
31
|
+
- `-L` 指定 fir-cli 的输出 log, 默认为 STDOUT
|
32
|
+
- `-V` Verbose, 默认为输出所有信息( INFO 和 ERROR), 如果设置 `--no-verbose`, 则只输出 ERROR 信息
|
33
|
+
- `-q` 静默模式, 默认关闭
|
34
|
+
- `-h` 查看相关命令帮助
|
data/doc/info.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
### fir info
|
2
|
+
|
3
|
+
`fir info` 命令用于查看当前 ipa/apk 相关信息.
|
4
|
+
|
5
|
+
```sh
|
6
|
+
$ fir info --help
|
7
|
+
Usage:
|
8
|
+
fir info APP_FILE_PATH
|
9
|
+
|
10
|
+
Show iOS/Android app info, support ipa/apk file (aliases: `i`).
|
11
|
+
```
|
12
|
+
|
13
|
+
#### 查看 ipa 相关信息
|
14
|
+
|
15
|
+
```sh
|
16
|
+
$ fir info ./build_ipa.ipa
|
17
|
+
|
18
|
+
I, [2016-03-08T12:28:29.310846 #11961] INFO -- : Analyzing ipa file......
|
19
|
+
I, [2016-03-08T12:28:29.310932 #11961] INFO -- : ✈ -------------------------------------------- ✈
|
20
|
+
I, [2016-03-08T12:28:29.395706 #11961] INFO -- : type: ios
|
21
|
+
I, [2016-03-08T12:28:29.395775 #11961] INFO -- : identifier: xx.xxx.build-ipa
|
22
|
+
I, [2016-03-08T12:28:29.395793 #11961] INFO -- : name: build_ipa
|
23
|
+
I, [2016-03-08T12:28:29.395805 #11961] INFO -- : display_name: build_ipa
|
24
|
+
I, [2016-03-08T12:28:29.395817 #11961] INFO -- : build: 1
|
25
|
+
I, [2016-03-08T12:28:29.395829 #11961] INFO -- : version: 1.0
|
26
|
+
I, [2016-03-08T12:28:29.396007 #11961] INFO -- : devices: ["fasdfafaf3f4xxxxxxx78aecbc1234567"]
|
27
|
+
I, [2016-03-08T12:28:29.396057 #11961] INFO -- : release_type: adhoc
|
28
|
+
I, [2016-03-08T12:28:29.396086 #11961] INFO -- : distribution_name: iOSTeam Provisioning Profile: xx.xxx.* - xxx xx xxxxxx LLC.
|
29
|
+
I, [2016-03-08T12:28:29.396111 #11961] INFO -- :
|
30
|
+
```
|
31
|
+
|
32
|
+
#### 查看 apk 相关信息
|
33
|
+
|
34
|
+
```sh
|
35
|
+
$ fir info ./test_apk.apk
|
36
|
+
I, [2016-03-08T12:30:25.241278 #12073] INFO -- : Analyzing apk file......
|
37
|
+
I, [2016-03-08T12:30:25.241363 #12073] INFO -- : ✈ -------------------------------------------- ✈
|
38
|
+
I, [2016-03-08T12:30:25.250430 #12073] INFO -- : type: android
|
39
|
+
I, [2016-03-08T12:30:25.250477 #12073] INFO -- : identifier: com.xxx.myapplication
|
40
|
+
I, [2016-03-08T12:30:25.250496 #12073] INFO -- : name: My Application
|
41
|
+
I, [2016-03-08T12:30:25.250509 #12073] INFO -- : build: 1
|
42
|
+
I, [2016-03-08T12:30:25.250520 #12073] INFO -- : version: 1.0
|
43
|
+
I, [2016-03-08T12:30:25.250532 #12073] INFO -- :
|
44
|
+
```
|
data/doc/install.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
### 安装
|
2
|
+
|
3
|
+
fir-cli 使用 Ruby 构建, 无需编译, 只要安装相应 gem 即可.
|
4
|
+
|
5
|
+
```sh
|
6
|
+
$ ruby -v # > 1.9.3
|
7
|
+
$ gem install fir-cli
|
8
|
+
```
|
9
|
+
|
10
|
+
#### 常见的安装问题
|
11
|
+
|
12
|
+
- 使用系统自带的 Ruby 安装, 需确保 ruby-dev 已被正确的安装:
|
13
|
+
|
14
|
+
```sh
|
15
|
+
$ xcode-select --install # OS X 系统
|
16
|
+
$ sudo apt-get install ruby-dev # Linux 系统
|
17
|
+
```
|
18
|
+
|
19
|
+
- 出现 `Permission denied` 相关错误:
|
20
|
+
|
21
|
+
在命令前加上 `sudo`
|
22
|
+
|
23
|
+
- 出现 `Gem::RemoteFetcher::FetchError` 相关错误:
|
24
|
+
|
25
|
+
更换 Ruby 的淘宝源(由于国内网络原因, 你懂的), 并升级下系统自带的 gem
|
26
|
+
|
27
|
+
```sh
|
28
|
+
$ gem sources --remove https://rubygems.org/
|
29
|
+
$ gem sources -a https://ruby.taobao.org/
|
30
|
+
$ gem sources -l
|
31
|
+
*** CURRENT SOURCES ***
|
32
|
+
|
33
|
+
https://ruby.taobao.org
|
34
|
+
# 请确保只有 ruby.taobao.org, 如果有其他的源, 请 remove 掉
|
35
|
+
|
36
|
+
gem update --system
|
37
|
+
gem install fir-cli
|
38
|
+
```
|
39
|
+
|
40
|
+
- Mac OS X 10.11 以后的版本, 由于10.11引入了 `rootless`, 无法直接安装 fir-cli, 有以下三种解决办法:**
|
41
|
+
|
42
|
+
1\. 使用 [Homebrew](http://brew.sh/) 及 [RVM](https://rvm.io/) 安装 Ruby, 再安装 fir-cli(推荐)
|
43
|
+
|
44
|
+
```sh
|
45
|
+
# Install Homebrew:
|
46
|
+
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
47
|
+
|
48
|
+
# Install RVM:
|
49
|
+
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby
|
50
|
+
|
51
|
+
$ gem install fir-cli
|
52
|
+
```
|
53
|
+
|
54
|
+
2\. 指定 fir-cli 中 bin 文件的 PATH
|
55
|
+
|
56
|
+
```sh
|
57
|
+
$ export PATH=/usr/local/bin:$PATH;gem install -n /usr/local/bin fir-cli
|
58
|
+
```
|
59
|
+
|
60
|
+
3\. 重写 Ruby Gem 的 bindir
|
61
|
+
|
62
|
+
```sh
|
63
|
+
$ echo 'gem: --bindir /usr/local/bin' >> ~/.gemrc
|
64
|
+
$ gem install fir-cli
|
65
|
+
```
|
data/doc/login.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
### fir login & fir me
|
2
|
+
|
3
|
+
`fir login` 命令用于使用 API token 登录 fir.im, 并使用发布应用等相关命令.
|
4
|
+
|
5
|
+
`fir me` 命令用于查看当前登录用户信息.
|
6
|
+
|
7
|
+
用户的 API token 可在 **[这里](http://fir.im/apps/apitoken)** 查看, 当使用 fir login 登录了之后, 后续命令都不需要加上 `-T` 参数, 会默认使用 **当前用户的 token** 进行相关操作.
|
8
|
+
|
9
|
+
```sh
|
10
|
+
$ fir login XXX_YOUR_API_TOKEN_XXX
|
11
|
+
I, [2016-03-08T12:48:56.499435 #13043] INFO -- : Login succeed, previous user's email: xxx@fir.im
|
12
|
+
I, [2016-03-08T12:48:56.507044 #13043] INFO -- : Login succeed, current user's email: xxx@fir.im
|
13
|
+
I, [2016-03-08T12:48:56.507147 #13043] INFO -- :
|
14
|
+
|
15
|
+
$ fir me
|
16
|
+
I, [2016-03-08T12:48:14.175488 #12986] INFO -- : Login succeed, current user's email: xxx@fir.im
|
17
|
+
I, [2016-03-08T12:48:14.175687 #12986] INFO -- : Login succeed, current user's name: xxx
|
18
|
+
I, [2016-03-08T12:48:14.175765 #12986] INFO -- :
|
19
|
+
```
|
data/doc/mapping.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
### fir mapping
|
2
|
+
|
3
|
+
`fir mapping` 指令用于将符号表上传至 [BugHD.com](http://bughd.com) 所对应的项目, 目前已经支持 dSYM 和 txt 两种格式的符号表文件上传, 有以下三种方法上传:
|
4
|
+
|
5
|
+
- 指定 version 和 build 上传:
|
6
|
+
|
7
|
+
```sh
|
8
|
+
$ fir m <mapping file path> -P <bughd project id> -v <app version> -b <app build> -T <your api token>
|
9
|
+
```
|
10
|
+
|
11
|
+
- 在 publish 的时候自动上传:
|
12
|
+
|
13
|
+
```sh
|
14
|
+
$ fir p <app file path> -m <mapping file path> -P <bughd project id> -T <your api token>
|
15
|
+
```
|
16
|
+
- 在 build_ipa 的时候自动上传:
|
17
|
+
|
18
|
+
```sh
|
19
|
+
$ fir b <project dir> -P <bughd project id> -M -p -T <your api token>
|
20
|
+
```
|
21
|
+
|
22
|
+
更详细的使用说明, 可以使用 `fir mapping -h`查看相应的帮助.
|
data/doc/publish.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
### fir publish
|
2
|
+
|
3
|
+
`fir publish` 命令用于可以发布应用到 fir.im, 支持 ipa 和 apk 文件.
|
4
|
+
|
5
|
+
```sh
|
6
|
+
$ fir publish --help
|
7
|
+
Usage:
|
8
|
+
fir publish APP_FILE_PATH
|
9
|
+
|
10
|
+
Options:
|
11
|
+
-s, [--short=SHORT] # Set custom short link
|
12
|
+
-c, [--changelog=CHANGELOG] # Set changelog
|
13
|
+
-Q, [--qrcode], [--no-qrcode] # Generate qrcode
|
14
|
+
-m, [--mappingfile=MAPPINGFILE] # App mapping file
|
15
|
+
-P, [--proj=PROJ] # Project id in BugHD.com if upload app mapping file
|
16
|
+
[--open], [--no-open] # true/false if open for everyone, the default is: true
|
17
|
+
# Default: true
|
18
|
+
[--password=PASSWORD] # Set password for app
|
19
|
+
-T, [--token=TOKEN] # User's API Token at fir.im
|
20
|
+
-L, [--logfile=LOGFILE] # Path to writable logfile
|
21
|
+
-V, [--verbose], [--no-verbose] # Show verbose
|
22
|
+
# Default: true
|
23
|
+
-q, [--quiet], [--no-quiet] # Silence commands
|
24
|
+
-h, [--help], [--no-help] # Show this help message and quit
|
25
|
+
```
|
26
|
+
|
27
|
+
相关参数详解:
|
28
|
+
|
29
|
+
- `-s` 参数, 自定义发布后的短链接地址.
|
30
|
+
- `-c` 参数, 自定义发布时的 changelog, 支持字符串与文件两种方式, 即 `--changelog='this is changelog'` 和 `--changelog='/Users/fir-cli/changelog'`.
|
31
|
+
- `-Q` 参数, 是否生成发布后二维码, 默认为不生成, 加上 `-Q` 参数后会在当前目录生成一张二维码图片, 扫描该图片即可下载该应用.
|
32
|
+
- `-m` 参数, 上传当前应用的符号表文件, 配合 `-P` 参数使用.
|
33
|
+
- `-P` 参数, [BugHD.com](http://bughd.com) 上相对应的 Project id.
|
34
|
+
- `--open` 参数, 设置发布后的应用是否开放给所有人下载, 默认为开放, 关闭开放使用 `--no-open` 参数.
|
35
|
+
- `--password` 参数, 设置发布后的应用密码
|
36
|
+
|
data/doc/upgrade.md
ADDED
data/fir-cli.gemspec
CHANGED
data/lib/fir/util/publish.rb
CHANGED
@@ -159,7 +159,7 @@ module FIR
|
|
159
159
|
@changelog = read_changelog(options[:changelog]).to_s.to_utf8
|
160
160
|
@short = options[:short].to_s
|
161
161
|
@passwd = options[:password].to_s
|
162
|
-
@is_opened = !!options[:open]
|
162
|
+
@is_opened = @passwd.blank? ? !!options[:open] : false
|
163
163
|
@export_qrcode = !!options[:qrcode]
|
164
164
|
end
|
165
165
|
|
data/lib/fir/version.rb
CHANGED
data/test/publish_test.rb
CHANGED
@@ -16,9 +16,22 @@ class PublishTest < Minitest::Test
|
|
16
16
|
|
17
17
|
def test_update_app_info
|
18
18
|
short = SecureRandom.hex[3..9]
|
19
|
-
passwd = SecureRandom.hex[0..9]
|
20
19
|
is_opened = (rand(100) % 2) == 0
|
21
20
|
|
21
|
+
update_info = { short: short, open: is_opened }
|
22
|
+
FIR.publish(default_ipa, @options.merge(update_info))
|
23
|
+
|
24
|
+
info = FIR.fetch_app_info
|
25
|
+
|
26
|
+
assert_equal short, info[:short]
|
27
|
+
assert_equal is_opened, info[:is_opened]
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_update_app_passwd
|
31
|
+
short = SecureRandom.hex[3..9]
|
32
|
+
is_opened = (rand(100) % 2) == 0
|
33
|
+
passwd = SecureRandom.hex[0..9]
|
34
|
+
|
22
35
|
update_info = { short: short, password: passwd, open: is_opened }
|
23
36
|
FIR.publish(default_ipa, @options.merge(update_info))
|
24
37
|
|
@@ -26,6 +39,6 @@ class PublishTest < Minitest::Test
|
|
26
39
|
|
27
40
|
assert_equal short, info[:short]
|
28
41
|
assert_equal passwd, info[:passwd]
|
29
|
-
assert_equal
|
42
|
+
assert_equal false, info[:is_opened]
|
30
43
|
end
|
31
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fir-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NaixSpirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -157,6 +157,15 @@ files:
|
|
157
157
|
- bin/console
|
158
158
|
- bin/fir
|
159
159
|
- bin/setup
|
160
|
+
- doc/build_apk.md
|
161
|
+
- doc/build_ipa.md
|
162
|
+
- doc/help.md
|
163
|
+
- doc/info.md
|
164
|
+
- doc/install.md
|
165
|
+
- doc/login.md
|
166
|
+
- doc/mapping.md
|
167
|
+
- doc/publish.md
|
168
|
+
- doc/upgrade.md
|
160
169
|
- fir-cli.gemspec
|
161
170
|
- lib/fir-cli.rb
|
162
171
|
- lib/fir.rb
|
@@ -206,7 +215,7 @@ metadata: {}
|
|
206
215
|
post_install_message: "\n ______________ ________ ____\n /
|
207
216
|
____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
|
208
217
|
/\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
|
209
|
-
\ ## 更新记录\n ### fir-cli 1.4.
|
218
|
+
\ ## 更新记录\n ### fir-cli 1.4.9\n - 修正 build 后直接 -p 发布的权限错误\n - 增加上传时候设置密码及公开访问权限\n
|
210
219
|
\ - 增加 build_ipa 中的 destination 参数\n - 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n
|
211
220
|
\ - [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源\n - 欢迎 fork, issue 和 pull
|
212
221
|
request\n "
|