Skip to content

Instantly share code, notes, and snippets.

@1ok1
Forked from christopherperry/adb+
Created July 11, 2021 19:35
Show Gist options
  • Save 1ok1/61ff83674e12d1f91c54de35bb1e64c9 to your computer and use it in GitHub Desktop.
Save 1ok1/61ff83674e12d1f91c54de35bb1e64c9 to your computer and use it in GitHub Desktop.
A bash script that let's you issue adb commands to multiple devices at once
#!/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
adb devices | while read line
do
if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ]
then
device=`echo $line | awk '{print $1}'`
echo "$device $@ ..."
adb -s $device $@
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment