deal with more than one connected device/emulator

This commit is contained in:
Eric House 2013-04-06 08:16:57 -07:00
parent 51d72447c6
commit 388d37e4ee

View file

@ -1,3 +1,27 @@
#!/bin/sh
adb uninstall org.eehouse.android.xw4
set -e -u
INDEX=0
usage() {
echo "usage: $0 [--help] [-n <index>]"
echo "uninstall crosswords from the <index>th device"
exit 0
}
while [ $# -ge 1 ]; do
case $1 in
-n)
shift
INDEX=$1
;;
*) usage
;;
esac
shift
done
SERIAL="$(adb devices | grep 'device$' | sed -n "$((1+INDEX)) p" | awk '{print $1}')"
adb -s $SERIAL uninstall org.eehouse.android.xw4