diff --git a/xwords4/android/scripts/adb_uninstall.sh b/xwords4/android/scripts/adb_uninstall.sh index 1623ff837..a20cbeb92 100755 --- a/xwords4/android/scripts/adb_uninstall.sh +++ b/xwords4/android/scripts/adb_uninstall.sh @@ -1,3 +1,27 @@ #!/bin/sh -adb uninstall org.eehouse.android.xw4 +set -e -u + +INDEX=0 + +usage() { + echo "usage: $0 [--help] [-n ]" + echo "uninstall crosswords from the 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