🚀 What is Fastlane, what can we do and how to install?

Ümit Bülbül
5 min readSep 24, 2022

--

Greetings, 👋

I’ve decided to start a series of articles where I’ll tell you what I know about Fastlane. I am sure that we will learn new and good things together in this process. 🥳

If you’re ready, let’s start. 💪

Why Should We Use Tools Like Fastlane?

When we create a new project or add such a tool to our existing project, it may seem like a difficult task at first. However, as the project progresses, it is quite possible that we will notice that we start to repeat some work from time to time.

While such works take our time every time, it can be a tedious process over time.

For example; increasing the version number, creating and distributing a new version, informing the relevant people about the new version, etc.

Repetitive processes that have the same jobs can be automated. 🪄✨

When we transfer these and similar processes to an auxiliary tool that does it for us, we no longer need to spare time for these processes. We have more time to add new features to our project, fix bugs, and improve ourselves and our project.

As another advantage; While the processes we automate are free from human error, the reliability of the system increases and works in a certain standard.

Well, what is 🚀 Fastlane ?

In short, Fastlane is an easy way to automate the creation and release of new versions to test and production environments for Android/iOS/Mac apps.

For example, it can also:

  • 📷 Can create localized screenshots and update metadata for app stores.
  • 📄 Can create Certificate and Provisioning Profiles for iOS applications. It can renew the expired ones and share them with other team members.
  • 🔔 You can send the steps and result of your transaction to platform channels such as Slack, Microsoft Teams, RocketChat as a message.
  • 🔗 It can be integrated with many tools such as Jenkins, CircleCI, TravisCI and Bitrise.
  • 🎮 Apart from the actions that Fastlane supports, different processes can be added to the process by running any terminal code with the sh command.

On top of all this, Fastlane is an open source project with many community-supported plugins. You can take a look at Fastlane Actions and Fastlane Plugins pages to explore their capabilities in detail.

I also recommend checking out Fastlane’s site and github page.

If you are ready, let’s move on to the installation. 💻

🚀 Fastlane Installation:

Fastlane requires Ruby version 2.5 or higher to work. You can also check all the requirements here before proceeding with the installation.

To check the current installation and version of Ruby, let’s run the following command in the terminal:

ruby -v

If Ruby is not installed or its version is lower than 2.5, we can use Homebrew, a widely used package manager on macOS, to install the latest version. If Homebrew is not installed, we can install it by running the following command in the terminal:

/usr/bin/ruby -e \
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Now let’s run the command to install the latest Ruby version:

brew install ruby

Then let’s run the following command to install Fastlane:

gem install fastlane

Let’s check that it was successfully installed:

fastlane -v

If our Fastlane version has appeared, our installation is complete 🥳

🚀 Let’s Add Fastlane to the Project:

In this section, we will provide installation on the Android platform. First, let’s go to the directory of our project in the terminal and run the following command:

fastlane init
  • Here it will ask us for the package name. Let’s enter the package name of the application.
  • Fastlane needs a JSON file, which we can also obtain from the Play Console, in order to be able to update its metadata and upload new versions in the Play Console. You can press Enter to skip. We can add this file later.
  • At this step, it asks if we want to download the existing metadata and screenshots from the Play Console to the fastlane folder. For this, we need to have uploaded the JSON file in the previous step. For now, we can skip this step with the n key.
  • When we see this screen, our installation is complete. 🥳 Here we can see the created files and their directories.

Now let’s take a look at what files Fastlane has added to our project.

  • Appfile: We can store values such as Apple ID, Bundle Indentifier, Package Name as key-values in this file and access and use them from Fastfile.
  • Gemfile: We use it to define the Fastlane version to use and its dependencies.
  • Fastfile: Used to configure Fastlane. Here we describe all the steps and actions we will take.

Fastlane works step by step according to the flow we created in the Fastfile file. Each stream is inserted into a lane. You can also create a nested lane.

We can take a look at how the tasks in a lane work step by step through the GIF below.

As another example, we can examine the step-by-step processes in the upload lane below through the comment lines.

Here we come to the end of our first article on Fastlane. Thank you for reading and good luck with your work. See you! 🙂 👋

--

--