There are multiple ways to get fastlane installed for your project.
You can use ruby gems:
sudo gem install fastlane
Or you could use Homebrew:
brew cask install fastlane
It is a good practice to use Gemfile, as this will ensure that all the collaborators use the same version of fastlane.
In the root directory, create Gemfile:
source "https://rubygems.org"
gem "fastlane"
You will then use bundler-related commands such as the following:
- bundle update: Updates your dependencies
- bundle install: Installs fastlane on the CI and developer’s machines
- bundle exec fastlane [action]: Executes the fastlane actions
For the rest of this section, we’ll use the fastlane command without the fastlane exec bundle for the sake of brevity. Please ensure it adapts to your use case.