Last active
August 29, 2015 14:03
-
-
Save basharam/f450e318a72e0bf4199e to your computer and use it in GitHub Desktop.
open adb shell for all devices connected to host(tested on ubuntu 12.04)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#getprocess=`adb devices` | |
#echo $getprocess | |
#set $getprocess | |
#deviceid=$5 | |
#echo $deviceid | |
#adb -s $deviceid shell | |
#if [ -z "$7" ]; then | |
#echo "connected devices: 1" | |
#else | |
#gnome-terminal -e adb -s $7 shell | |
#echo "" | |
#fi | |
kdevice_str=device | |
k=0 | |
#Pipe adb devices output to while and read junk_str variable as akey | |
#to parse the string | |
adb devices | while read dev_id dev_str junk_str | |
do | |
if test "$dev_str" = "$kdevice_str" && test -z "$junk_str" | |
then | |
k=$(($k+1)) | |
echo $dev_str id $dev_id $k | |
#xterm -T "$dev_id" -e adb -s $dev_id shell & | |
else | |
: | |
fi | |
done | |
echo $k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment