xwords/xwords4/android/scripts/uninstall.sh

43 lines
765 B
Bash
Raw Normal View History

#!/bin/sh
2012-02-22 18:49:57 +01:00
set -u -e
2012-02-28 04:32:57 +01:00
VARIANT=xw4
2012-02-22 18:49:57 +01:00
usage() {
[ $# -ge 1 ] && echo "Error: $1"
2012-02-28 04:32:57 +01:00
echo "usage: $(basename $0) [-e] [-d] [-v variant]"
2012-02-22 18:49:57 +01:00
exit 1
}
DEVICES=""
while [ $# -ge 1 ]; do
case $1 in
-e)
DEVICES="$DEVICES $(adb devices | grep '^emulator' | awk '{print $1}')"
;;
-d)
DEVICES="$DEVICES $(adb devices | grep -v emulator | grep 'device$' | awk '{print $1}')"
;;
2012-02-28 04:32:57 +01:00
-v)
shift
VARIANT=$1
;;
2012-02-22 18:49:57 +01:00
*)
usage
;;
esac
shift
done
COUNT=0
for DEVICE in $DEVICES; do
echo $DEVICE
2012-02-28 04:32:57 +01:00
adb -s $DEVICE uninstall org.eehouse.android.${VARIANT}
2012-02-22 18:49:57 +01:00
COUNT=$((COUNT+1))
done
2012-02-22 18:49:57 +01:00
echo "removed from $COUNT devices/emulators"