1、安裝
sudo gem install fastlane -NV
2、判斷安裝是否成功過以及版本
fastlane --version
3、切換到項(xiàng)目目錄
4、安裝到項(xiàng)目
fastlane init
->遇到問題:
bundle update 卡住
ruby源可能被墻
~ gem source -l
->更新源
5、安裝蒲公英插件
fastlane add_plugin pgyer
蒲公英有官方文檔
6、在項(xiàng)目目錄找打Fastlane文件夾,編輯Fastfile,寫自己的lane
e.g.
打包到蒲公英
desc "打包到pgy"
lane :test do |options|
gym(
clean:true, #打包前clean項(xiàng)目
export_method: "ad-hoc", #導(dǎo)出方式
scheme:"BasisProject", #scheme
configuration: "Release",#環(huán)境
output_directory:"~/Desktop/app",#ipa的存放目錄
output_name:"BasisProject_"+get_build_number()#輸出ipa的文件名為當(dāng)前的build號(hào)
)
蒲公英的配置 替換為自己的api_key和user_key
pgyer(api_key: "XXXXXXXXX", user_key: "XXXXXXXX",update_description: options[:desc],install_type:"2",password:"XXXXXX")
end
7、運(yùn)行命令
fastlane test
->遇到問題
命令行報(bào)錯(cuò)
tool 'xcodebuild' requires Xcode, but active developer directory
Xcode目錄或需重置,命令
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer