0%

fastLane入门之plugin

fastlane是一套ruby脚本工具, 用于实现iOS或Android的持续集成及自动化发布. fastlane的安装及更多相关介绍参见其Github:fastlane)).

本文使用的fastlane版本为2.47.0. 低版本可能会产生各种莫名其妙的问题. 配置fastlane时最好先翻墙,原因你懂的.

本文主要介绍使用fastlane插件firim的使用.

plugin命令介绍

列出所有可用插件:

fastlane search_plugins

搜索指定名称的插件:

fastlane search_plugins [query]

添加插件:

fastlane add_plugin [name]

安装插件:

fastlane install_plugins

firim配置

使用上面的plugin命令安装插件firim, 安装完成后会生成3个文件:

  • Gemfile
  • Gemfile.lock
  • fastlane/Pluginfile

前往fir.im平台注册账号并生产API token.

Fastfile中新建一个lane:

  desc "Deploy a test version to the fir.im"
  lane :deployFirim do
    createIpa
    firim(firim_api_token: "your firim token")
  end
  

其中createIpa参见fastLane入门之ipa打包.

如果你的项目使用了cocoapods, 需要在Gemfile中添加一行:

gem 'cocoapods'

打包并上传

cd到项目目录下, 执行命令:

fastlane deployFirim

登录fir.im 查看, 应用已经上传完成.