Make it easy to ship TestFlight builds of your iOS app with fastlane
fastlaneiostestflightSetting up fastlane #
This post covers how to use fastlane to ship beta builds of your iOS app to TestFlight.
This post is intentionally light on details and explanations. Instead, it focuses on taking the simple, direct path to getting your builds running.
If you'd like to learn more about the details behind this guide, I'd suggest reading:
Prerequisites #
Fastlane requires:
- ruby
- the
bundler
gem
Please see the fastlane docs for more details.
Install fastlane and configure beta builds #
-
Create a
Gemfile
with these contents:source "https://rubygems.org"
gem "fastlane" -
Install fastlane with bundler
bundle install
-
Initialize your fastlane config
bundle exec fastlane init
-
When prompted, choose option
2. Automate beta distribution to TestFlight
-
When prompted, enter your Apple ID and log in.
-
If you have more than one team, you will be asked to select which to use for this project.
Setup fastlane match for codesigning: #
-
Initialize fastlane match config for codesigning
bundle exec fastlane match init
-
Choose
git
-
Create a private git repo and paste the URL into the fastlane prompt
-
Sync your appstore (production) codesigning
bundle exec fastlane match appstore
-
You will be prompted for a passphrase. This is the key to unlock your signing certs and should be kept secret! I highly recommend using a password manager to store this.
-
Sync your development codesigning
bundle exec fastlane match development
-
Go into xcode, and disable "automatic manage signing". Then select the "match" profile for each of the options (debug and release).
You are all set! If you get stuck or run into any problems, take a look at the fastlane match docs for help.
Using fastlane #
To publish a TestFlight build, run:
bundle exec fastlane beta
You may be prompted to authenticate with your developer account during the process.
The build may take a significant amount of time depending on your app. Building my react native app typically takes 15-30 minutes on my laptop.
Possible errors during setup #
["Apple provided the following error info:", "Access Unavailable", "You currently don't have access to this membership resource. To resolve this issue, agree to the latest Program License Agreement in your developer account."]
- Go to https://appstoreconnect.apple.com/
- Log in with your Apple ID
- Accept the new developer agreement
- Try again