Getting started with fastlane for iOS
Setup Xcode for fastlane
Xcode command line tools (macOS)
xcode-select --install
Installing fastlane
fastlane can be installed multiple ways. The preferred method is with a Gemfile
. fastlane can also get installed directly through RubyGems or with Homebrew (if on macOS).
A Gemfile (macOS/Linux/Windows)
It is recommended that you use a Gemfile
to define your dependency on fastlane. This will clearly define the used fastlane version, and its dependencies, and will also speed up using fastlane.
- Create a
./Gemfile
in the root directory of your project with the content
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
RubyGems (macOS/Linux/Windows)
sudo gem install fastlane -NV
Homebrew (macOS)
brew install fastlane
Setting up fastlane
Navigate your terminal to your project's directory and run
fastlane init
To have your Fastfile
configuration written in Swift (Beta)
fastlane init swift
Swift setup is still in beta. See Fastlane.swift docs for more information.
Depending on what kind of setup you choose, different files will be set up for you. If you chose to download the existing app metadata, you'll end up with new folders that look like this:
The most interesting file is fastlane/Fastfile
, which contains all the information that is needed to distribute your app.
What's next?
fastlane created all the required files for you, now you can go ahead and customise it to generate screenshots or to automatically distribute new builds
- Generate localized iOS screenshots for the App Store
- Automatic iOS Beta deployment
- Automatic iOS App Store deployment
Set up environment variables
fastlane requires some environment variables set up to run correctly. In particular, having your locale not set to a UTF-8 locale will cause issues with building and uploading your build. In your shell profile add the following lines:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
You can find your shell profile at ~/.bashrc
, ~/.bash_profile
, ~/.profile
or ~/.zshrc
depending on your system.
Use a Gemfile
It is recommended that you use a Gemfile
to define your dependency on fastlane. This will clearly define the used fastlane version, and its dependencies, and will also speed up using fastlane.
- Create a
./Gemfile
in the root directory of your project with the content
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