1、安装
sudo gem install fastlane -NV
2、判断安装是否成功过以及版本
fastlane --version
3、切换到项目目录
4、安装到项目
fastlane init
->遇到问题:
bundle update 卡住
ruby源可能被墙
~ gem source -l
->更新源
5、安装蒲公英插件
fastlane add_plugin pgyer
蒲公英有官方文档
6、在项目目录找打Fastlane文件夹,编辑Fastfile,写自己的lane
e.g.
打包到蒲公英
desc "打包到pgy"
lane :test do |options|
gym(
clean:true, #打包前clean项目
export_method: "ad-hoc", #导出方式
scheme:"BasisProject", #scheme
configuration: "Release",#环境
output_directory:"~/Desktop/app",#ipa的存放目录
output_name:"BasisProject_"+get_build_number()#输出ipa的文件名为当前的build号
)
蒲公英的配置 替换为自己的api_key和user_key
pgyer(api_key: "XXXXXXXXX", user_key: "XXXXXXXX",update_description: options[:desc],install_type:"2",password:"XXXXXX")
end
7、运行命令
fastlane test
->遇到问题
命令行报错
tool 'xcodebuild' requires Xcode, but active developer directory
Xcode目录或需重置,命令
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
网友评论