iOS 打包分发快车道fastlane

2018-11-14  本文已影响18人  zhouyuhan
fastlane

fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. 🚀 It handles all tedious tasks, like generating screenshots, dealing with code signing, and releasing your application.

一、安装xcode命令行工具

xcode-select --install

二、安装Fastlane

终端运行--->
sudo gem install fastlane -NV
或者
brew cask install fastlane

三、初始化Fastlane

cd到项目根目录并运行--->
fastlane init
运行后按照提示选择下去,中间会让你输入苹果的帐号,输入后一段时间会提示successful

编辑Fastfile

fastlane初始化成功后项目根目录会多出falstlane文件夹

image.png
这时我们编辑里面的Fastfile
image.png
每一个lane相当于一个方法,lane则为定义方法的关键字, 后面为方法名类似的起名规则
这里我定义了两个lane, 一个是上传TestFlight用的, 一个是因为自己项目的原因上传FTP用的, ftp的上传需要安装fastlane的插件, 这里可以终端运行
fastlane add_plugin ftp
build_app内参数说明

运行Fastlane

尝试运行刚才添加的两个方法其中之一的beta
fastlane beta
运行后,有报错的话,可以尝试修改

image.png
再次运行fastlane beta,大功告成
上一篇下一篇

猜你喜欢

热点阅读