Skip to content

Instantly share code, notes, and snippets.

@wuyexiong
Created July 21, 2014 09:11
Show Gist options
  • Save wuyexiong/08358c1e52a645a14e67 to your computer and use it in GitHub Desktop.
Save wuyexiong/08358c1e52a645a14e67 to your computer and use it in GitHub Desktop.
Here's a simple bash script for easily installing and uninstalling APKs with multiple devices connected to a computer.
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
# study from here >>> http://engineering.meetme.com/2014/07/quick-tip-how-to-install-or-uninstall-apks-on-multiple-android-devices-with-just-one-command/
adb devices | while read line
do
if [[( `echo $line | awk '{print $2}'` = "device" ) ]]
then
device=`echo $line | awk '{print $1}'`
echo "adb -s $device $@ ..."
adb -s $device $@
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment