Fir配置命令行上传

一、 安装Fir-cil

1.通过RubyGems安装fir-cli

#先判断有没有Ruby环境,没有gem就先装gem并配置gem源,有可以更新ruby版本
ruby -v
//e.g.
//ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]

#确定有没有安装Rubygem,有就继续,没有就自行安装(插入步骤2 安装RVM )
gem -v
//e.g.
//3.0.1
#有了gem,通过gem安装Fir-cli 
sudo gem install fir-cli                                  //MacOS10.10以前
sudo gem install -n /usr/local/bin fir-cli                //MacOS10.10以后
#安装成功
//e.g.
        ______________        ________    ____
       / ____/  _/ __ \      / ____/ /   /  _/
      / /_   / // /_/ /_____/ /   / /    / /
     / __/ _/ // _, _/_____/ /___/ /____/ /
    /_/   /___/_/ |_|      \____/_____/___/

  ## 更新记录
  - (1.6.12) 修复了部分机器没有默认安装 byebug 的问题
  - (1.6.11) 变化了 ruby gem 仓库地址
  - (1.6.10) 增加显示release_id 以及 app_id
  - (1.6.9) 取消了依赖 cfpropertylist 的具体版本号
  - (1.6.8) 取消了远端回调, 改为本地callback
  - (1.6.8) fir-cli 也支持了私有部署模式
  - [fir-cli](https://github.com/firhq/fir-cli) 已经开源
  - 欢迎 fork, issue 和 pull request

Successfully installed fir-cli-1.6.12

2. 通过Homebrew安装RVM

#判断有没有Homebrew,没有Homebrew就自行安装
brew -v 
//e.g.
//Homebrew 1.9.2
//Homebrew/homebrew-core (git revision 303ea; last commit 2019-01-22)

#安装Homebrew(已安装的可以跳过)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

#brew安装完成
brew help
//通过help命令检测一下是不是安装成功
//e.g.
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

//Tips:会列出需要安装的Script并提示Press RETURN to continue or any other key to abort
//直接按回车就继续了
//e.g. ==> Downloading and installing Homebrew...

#安装RVM
\curl -sSL https://get.rvm.io | bash -s stable --ruby
//e.g.
//Downloading https://github.com/rvm/rvm/archive/1.29.7.tar.gz

#ruby安装成功
//e.g.
//Already installed ruby-2.6.0.
To reinstall use:

    rvm reinstall ruby-2.6.0

Creating alias default for ruby-2.6.0.....

  * To start using RVM you need to run `source /Users/mac/.rvm/scripts/rvm`
    in all your open shell windows, in rare cases you need to reopen all shell windows.

二、配置环境变量

# 指定 fir-cli 中 bin 文件的 PATH
$ export PATH=/usr/local/bin:$PATH

# 重写 Ruby Gem 的 bindir(实验没发现啥用)
$ echo 'gem: --bindir /usr/local/bin' >> ~/.gemrc

#实验fir环境变量
fir help

三、配置用户信息

Fir配置命令行上传_第1张图片
APIToken.png

Fir配置命令行上传_第2张图片
image.png
#登陆Fir账户
fir login
//e.g.需要输入你的APIToken
Please enter your fir.im API Token:
//这在Fir.im登陆后生成的复制下来就好了,如附图
#登陆成功之后,检测当前用户
fir me
//e.g.
//I, [2019-01-23T15:02:50.549056 #77636]  INFO -- : Login succeed, current user's email: [email protected]

四、发布到Fir.im

#基本操作
//这个命令的基本操作是fir+publish+本地路径
fir publish APP_FILE_PATH
//e.g.
//fir publish /Users/mac/Desktop/Payload.ipa -c='测试命令行发包,请忽略这个包' -Q

#补充命令
  -s, [--short=SHORT]              # Set custom short link(设置后边的短链接)
  -c, [--changelog=CHANGELOG]      # Set changelog(填写更新日志,支持字符串或者文本文件)
  -Q, [--qrcode], [--no-qrcode]    # Generate qrcode(在ipa/apk同级目录生成下载二维码)
  -m, [--mappingfile=MAPPINGFILE]  # App mapping file
  -P, [--proj=PROJ]                # Project id in BugHD.com if upload app mapping file
      [--open], [--no-open]        # true/false if open for everyone
      [--password=PASSWORD]        # Set password for app
  -T, [--token=TOKEN]              # User's API Token at fir.im
  -L, [--logfile=LOGFILE]          # Path to writable logfile
  -V, [--verbose], [--no-verbose]  # Show verbose(展示进度详情)
                                   # Default: true
  -q, [--quiet], [--no-quiet]      # Silence commands
  -h, [--help], [--no-help]        # Show this help message and quit

你可能感兴趣的:(Fir配置命令行上传)