As you may know, every time we release or update android app, we have build sign apk and add to store then add description, screenshots, etc. It’s the same things but you have to done every time you release or update your android app.
fastlane - App automation done right
Automate the most time-consuming beta distribution steps including incrementing the build version, code signing…
I will Implement it one by one. But before the implementation, let’s start setting up Fastlane first.
install the latest Xcode command line tools:
$ xcode-select --install
install fastlane using
$ sudo gem install fastlane -NV
$ brew cask install fastlane
After you have installed Fastlane successfully, add the below lines to your shell profile (typically ~/.bashrc or ~/.bash_profile or (if you are like me) ~/.zshrc).
That’s it about Fastlane installation.
If you are installing via RubyGems you should install Gem first before install Fastlane.
If you are installing via Homebrew, make sure you have installed brew before installing Fastlane.
Setting up Fastlane
Navigate to your project directory then
$ fastlane init
This command is to initialize fastlane to your project and it will require your app package name. Then it will ask for Path to the json secret file but you can skip it first, I’ll explain later on Play Store Deployment section and also skip for Download existing metadata and setup metadata managment.
After finish initialize fastlane, you will see fastlane folder and inside that it has two files:
- Appfile: where you put your package name and json secret file
- Fastfile: where you write your configuration
These code is auto generated by Fastlane when you initialize fastlane.
Syntax of writing config in fastlane
desc "Your lane description"
lane :your_lane_name do
As you can see in our Fastfile now have several lane. The first lane is
lane :testinside that lane has
gradle(task:"test").It mean this lane is going to run unit test for your whole project.
To run it using
$ bundle exec fastlane test
After that you will see your result whether it passed or failed like the picture above.
Finally you have run your first fastlane.
That’s all for now. In next blog I will show you how to use Automate Screenshot in our android app. Let me know if you have any problem! 😍