Batch install multiple apks

There are often a situation where I need to install not few but 18 apps in android for testing. Innumerous devices supported by different versions of android and the bug fixes which translates into more dev and release builds adds more pain to the situation.

As an avid commandline freak, I used the following small script to batch install the apks found in a directory. To use the script, copy all your apks to a dir along with the script and execute it,

I assume adb and aapt in your path already.

#!/bin/bash
$dir=`pwd`
for i in `ls $dir`
do
aapt dump badging $i | perl -ne 'print $2 if /package: name=(.)(.+?)\1/' | xargs -I{} adb uninstall {}
adb install $i
done

You can replace the contents of the for loop with following if you dont worry about reinstalling apps with existing data.

adb install -r $i
Advertisements

One Response to Batch install multiple apks

  1. […] post explains my quest to achieve a solution for iOS devices, similar to batch install in android. Remember my requirement is to smell and taste the coffee rather than installing 18 apps ( multiply […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: