Fastlane Setup for Flutter

Kadriye Macit
4 min readJan 29, 2023

Hello everyone!

In this article, I talk about one of the popular app deployment tools used to save time in some stages when developing applications. How we install Fastlane into our Flutter project and what we can do using Fastlane are fun topics. That’s why we start with the Fastlane installation.

What is Fastlane?

We write these commands in the terminal to setup Fastlane:

gem install fastlane

or

brew install fastlane

After, we need to integrate android and iOS separately. Let’s start with android.

cd android

fastlane init

It asks us for a package name. We can look at the project’s package name from android/app/src/main/AndroidManifest.xml file.

You can add the json secret file later. But, if you want to add it now, you can do it by following this link to learn how we create this file. I’m clicking enter, because I don’t need this file right now.

We click y and we click Enter 3 times, then it’s ready for android! 🚀

There are the new Fastlane files in android folder. We use mostly Fastfile and Appfile files.

Now we can switch to iOS.

cd ..

cd ios

fastlane init

We select option 2 because i’ll show how we use Fastlane and Testflight together in the next article. So we can automatically upload our app to Testflight and test it.

We enter Apple ID Username for iOS. This is an email address. It asks us for the App Store Connect teams name, if we have more teams in our Apple account. Once again, we click enter 3 times and complete our installation for iOS.

There are new Fastlane files in the iOS folder.

We use some commands to run Fastlane for android and iOS.

bundle exec fastlane

If we run the command above, wish is the main command, we can see these information texts. It asks us for which lane to run at the Fastfile file.

Let’s look at Fastfile file for seeing this lane.

We see the lane line named custom_lane. So we should run the following command with the lane’s name.

bundle exec fastlane custom_lane

This command line works and we’re ready for using Fastlane in our project. We add code lines in Fastfile file for any specific features: Firebase App Distribution, TestFlight, AppStore, Google Play Store, Slack…

I’ll write about how we can use them with Fastlane. So, see you next articles!

Thanks for reading!
Any comments or suggestions are welcome!

Check out my YouTube channel here and Twitter here.

--

--

Kadriye Macit

Sr. Flutter Developer - Software Engineer || Google Developer Expert for Flutter&Dart