-
-
Save christopherperry/3208109 to your computer and use it in GitHub Desktop.
#!/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 |
No script needed.
This command works perfect
adb devices | awk 'NR>1{print $1}' | xargs -n1 -I% adb -s % install foo.apk
thebagchi
Thank you for sharing your .bat I look forward to testing it.
Hi guys, how do I get started? Do I drop the file in platform-tools and it's ready to go? Simply use adb+ followed by commands?
shell commands do not work with multiple devices. Shell commands only hit the first device. Non shell commands, such as install, push and pull work fine on multiple devices
adb devices | awk 'NR>1{print $1}' | xargs -n1 -I% adb -s % install foo.apk
Thank you very much! Works perfectly fine, exactly what i was looking for.
@sivze You're right, this command does work perfectly. Thanks for the simple solution!
No script needed.
This command works perfect
adb devices | awk 'NR>1{print $1}' | xargs -n1 -I% adb -s % install foo.apk
I had the same issue like above and found some inspiration here: http://stackoverflow.com/questions/17047659/bash-enumerate-all-the-attached-devices
I changed my script to:
This works for me.