Created
June 4, 2015 23:01
-
-
Save samdfonseca/f5fa04a01cd69c77c923 to your computer and use it in GitHub Desktop.
Make adb easier with multiple devices
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 | |
_adbd () { | |
if [ "$1" ] | |
then | |
devices=(${=$(_adbdevices $1)}) | |
if [ "$devices[2]" ] | |
then | |
echo "Matched multiple devices. Please specify search." | |
for device in $devices | |
do | |
echo $device | colout $1 red bold | |
done | |
else | |
if [ "$@[2]" ] | |
then | |
adb -s "$devices[1]" "$@[2,-1]" | |
else | |
adb | |
fi | |
fi | |
else | |
adb devices | |
fi | |
} | |
alias adbd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment