开始使用fastlane配置fastlane
安装fastlane
安装最新版本的Xcode
xcode-select --install
安装fastlane
//使用rubygems
sudo gem install fastlane -NV
// 或者使用 Homebrew
brew cask install fastlane
设置fastlane
在终端(terminal)中进入项目目录并执行
fastlane init
如果是使用swift进行fastfile配置(Beta)
fastlane init swift
使用swift语言进行设置还在测试中,在Fastlane.swift docs获取更多信息.
根据选择的不同,fastlane将为你创建不同的文件.如果你选择下载已存在app的元数据(metadata),新的目录如下:
最主要的文件为fastlane/Fastfile,发布你的app所需要的所有信息都包含在其中.
下一步
fastlane已经帮你创建你所需要的所有文件,下载你可以自定义屏幕截图或者自动化打包
- Generate localized iOS screenshots for the App Store
- Automatic iOS Beta deployment
- Automatic iOS App Store deployment
设置环境变量
fastlane需要一些环境变量用以正常运行,通常如果本地未将编码设置成UTF-8打包上传时将会失败.你可以在你的shell profile中添加以下几行
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
根据系统的不同你可以在 ~/.bashrc, ~/.bash_profile, ~/.profile or ~/.zshrc 中找到shell文件
使用gemfile
我们推荐使用Gemfile定义你的fastlane依赖.这会清楚的定义您使用的fastlane版本,它的依赖库,并且提升使用fastlane的速度.
- 在根目录或者项目目录下创建
./Gemfile
source "https://rubygems.org"
gem "fastlane"
- Run [sudo] bundle update and add both the ./Gemfile and the ./Gemfile.lock to version control
- Every time you run fastlane, use bundle exec fastlane [lane]
- On your CI, add [sudo] bundle install as your first build step
- To update fastlane, just run [sudo] bundle update fastlane
网友评论