A Groovy Script to Save Them All

Apr 19, 2017 · 2 min read
Gradle Gradle Gradle

In #3, I talked about user support, but let’s get back into the world of coding and productivity, specifically a gradle task to archive apks and proguard files on build.

Busy Peeps: Here’s the groovy/gradle task

Painful APKs and Keeping Organized

At Pressure Labs we keep an archive of all past apks and proguard maps for just in case.

While I am not proud of, I will still admit that for the longest time, I did this manually 🤢.

But hold on I’m not finished! After seeing the horrible pain this was, I decided to dive into the wonderful world of that weird forgotten build called Gradle.

Under the hood gradle, like any build tool, executes tasks to build your apk. Neat part is you can create your own tasks to run on a command line.

Deploying My Fears Away

With the friendly help of the internet I wrote a a small script for myself called deployApks which has saved me a considerable amount of time.

Add to the bottom of your app/build.gradle


Android Studio manages build system internally, so I haven’t really attempted to integrate the task into the building and signing process

(edit; Thanks to Manoj Madanmohan for letting us know you can actually intergrate this quite easily!)

However, for the times I update our available apps, this saves me a considerable amount of time in manual manipulation of apk files and folders.


Build your signed APK via Android Studio

Build > Signed APK > [Enter Your Signing Credentials] > Done

Run ./gradlew deployApks

Magic Happens

And voila!

A a shiny new .admin folder with archived apks, version numbers and mappings! 🎉🎉🎉🎉

Woah are we finished already? Not Quite!

Thanks for checking out this article. I’ve got more though don’t worry! Check out my podcast on startups and entrepreneurs!