一、 Fastlane 是什么?
Fastlane 是一套使用Ruby寫的自動化工具集,旨在簡化Android和iOS的部署過程,自動化你的工作流。它可以簡化一些乏味、單調、重復的工作,像截圖、代碼簽名以及發(fā)布App
Fastlane開發(fā)文檔: https://docs.fastlane.tools/
二、應用
-
安裝xcode命令行工具
xcode-select --install -
安裝Fastlane
sudo gem install -n /usr/local/bin fastlane -
初始化,cd 到你的項目目錄執(zhí)行, 執(zhí)行完,之后有個選項,選擇 4,自定義配置
fastlane init -
配置 Fastfile, 在項目目錄中,找到 fastlane/Fastfile,修改內容如下
default_platform(:ios) platform :ios do desc "打包到蒲公英" lane :beta do build_app(export_method: "development") pgyer(api_key: "", user_key: "",password: "123", install_type: "2",update_description: "修復bug") end endapi_key、user_key :在蒲公英賬號的
應用管理-App概述-API中可以找到,并替換到以上相應的位置。
password: 安裝密碼update_description: 版本更新時的描述信息
-
安裝蒲公英的 fastlane 插件
fastlane add_plugin pgyer -
打包并上傳到蒲公英
fastlane beta
三、常見問題
-
gem ruby源已更新為 https://gems.ruby-china.com,確保只有 gems.ruby-china.com
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ gem sources -l