Internal distribution of builds is a time consuming and tedious process that each and every software developer needs to go through to make sure that the software that they are producing is designed, developed and tested to be fit for users.

At Mubaloo, this process has become a part of each iteration of an app and therefore takes a considerate amount of time. Recently Daniel Box (QA Manager at Mubaloo) and I successfully managed to shrink the amount of time we need to distribute a build to multiple Android devices by 80% by doing a bit of research and scripting.
Android build distribution can be done in a number of ways:
1. Sending an *.apk file as attachment to email: This takes too much time to set-up emails on multiple devices, this is also not a very secure way of managing devices as they are used by designers, developers, QA and clients.
2. Through hyperlink: Typing hyperlinks takes too much time when done on multiple devices and sending them through email would have the same issue as point 1.
3. Using the Terminal and ADB (Android Debug Bridge): This method is quick and easy way but is limited to only the device attached. In addition to this, you need to uninstall the previous build (which you must know the product name for).
4. Copy & paste the *.apk file in the attached device folder: You need to connect each device individually (therefore drivers) and then to install the *.apk from the device.
The only approach that seemed worthwhile for the automation process was the Terminal and ADB distribution. Mac OS Terminal allows various Unix based shell scripting environments to be used – bash, csh, tcsh etc., whereas ADB enables a quick and easy way to install/replace/uninstall *.apk files to the device attached. The uninstall command requires the package name of the *.apk which I managed to obtain using the AAPT (Android Asset Packaging Tool).
I ended up using Bash script to create a shell that can be used to Install/Replace/Uninstall *.apk files from the same folder where the shell is, as well as Install All/Replace All/Uninstall All *.apk files to all devices attached. At the end of the installation, the app is launched on all devices (this feature is omitted from Install All as you would not want to start all the apps in the folder at once on all devices).
Timed using 7 devices attached to a hub:
Video: Uninstall MetOffice –> Install MetOffice –> Launch MetOffice on all 7 devices took 1 minute and 35 sec (we have stripped the boring bit in the video for you).
To download the shell script and see a step-by-step tutorial on how to use it please visit my website.
Valentin Kalchev
QA Engineer at Mubaloo

Join Our Mailing List

You have Successfully Subscribed!