本文接上篇文章主要說下怎樣使用 fastlane 上傳到fir和蒲公英,下面先介紹下 plugin 命令。
plugin命令介紹:
列出所有可用插件
fastlane search_plugins
搜索指定名稱的插件:
fastlane search_plugins [query]
添加插件:
fastlane add_plugin [name]
安裝插件:
fastlane install_plugins
一. 上傳到fir
1.1 安裝fir:
fastlane add_plugin fir
安裝完成會(huì)生成3個(gè)文件
. Gemfile
. Gemfile.lock
. fastlane/Pluginfile

如果你的項(xiàng)目使用了cocoapods, 需要在Gemfile中添加一行:
gem 'cocoapods'
1.2 在Fastfile中新建一個(gè)lane:
desc "Deploy a test version to the fir.im" lane :Firim do createIpa firim(firim_api_token: "your firim token") end
createIpa 請(qǐng)參考上篇文章
your firim token 這里要替換成你自己的 firim_api_token ,如果你還沒有 fir賬號(hào)請(qǐng)前往 fir.im 平臺(tái)注冊(cè)賬號(hào)并生產(chǎn)API token。
1.3 上傳fir:
. 打開終端,cd到項(xiàng)目目錄下
. 執(zhí)行命令: fastlane Firim
二. 上傳到蒲公英
2.1 安裝蒲公英:
fastlane add_plugin pgyer
稍等幾秒鐘,如果出現(xiàn)類似下面的信息,就說明安裝成功了:
2.2 在Fastfile中新建一個(gè)lane:
lane :pgyer do createIpa pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", user_key: "4a5bcxxxxxxxxxxxxxxx3a9e",update_description: "版本更新描述") end
以上的 api_key 和 user_key,請(qǐng)開發(fā)者在自己 蒲公英 賬號(hào)下的 應(yīng)用管理 - App概述 - API 中可以找到,并替換到以上相應(yīng)的位置。
update_description:為版本更新描述。
2.3 上傳到蒲公英:
. 打開終端,cd到項(xiàng)目目錄下
. 執(zhí)行命令: fastlane pgyer
以上很多知識(shí)都來自互聯(lián)網(wǎng),還有自己的一些總結(jié)。
侵立刪, 有不對(duì)的地方望指正。