Though the official guide tells us how to generate our builds by clicking one and another menu options in Android Studio, but we don’t always have to generate every release artifact manually, nowadays we can automate almost every kind of software artifact with docker.
A signed release apk or aab file can be easily generated from Linux commandline if you have configured your signing and packaging options in your build.gradle file. And there is no difference in doing it in a docker pipeline.
I’ve already automated my packaging procedure in two steps:
# I prefer an enrironment based on ubuntu.
2. Configure pipeline on Gitlab so that whenever I push code to the repo, the automation jobs get triggered
image: shinchven/android-build:29 # Use the building env image we have prepared at step 1.
Thanks to the automation, now I only need to focus on my coding. When I am done with coding, I just push my code to my private repo and leave all the testing and packaging jobs to the CI server. After a cup of coffee, the artifact is there for me to grab.
Is that if you lint, test and build your release apk/aab every time you commit your code, your face won’t be punched by any lint and proguard errors when you need to generate a new release in a hurry.