fix to work when both -e and -d passed

This commit is contained in:
Eric House 2013-11-10 09:01:52 -08:00
parent f27e798966
commit ad464b8861

View file

@ -10,15 +10,17 @@ usage() {
exit 1
}
DEVICES="$(adb devices | grep 'device$' | awk '{print $1}')"
DEVICES=''
while [ $# -ge 1 ]; do
case $1 in
-e)
DEVICES="$(adb devices | grep '^emulator' | awk '{print $1}')"
DEV="$(adb devices | grep '^emulator' | awk '{print $1}')"
DEVICES="$DEVICES $DEV"
;;
-d)
DEVICES="$(adb devices | grep -v emulator | grep 'device$' | awk '{print $1}')"
DEV="$(adb devices | grep -v emulator | grep 'device$' | awk '{print $1}')"
DEVICES="$DEVICES $DEV"
;;
-p)
[ $# -gt 1 ] || usage "-p requires an argument"