From bbbc8124ba2f7475eab98070592aa7f6ae8eec0e Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 6 Dec 2013 07:37:56 -0800 Subject: [PATCH] uninstall based on where called from --- xwords4/android/scripts/adb_uninstall.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/xwords4/android/scripts/adb_uninstall.sh b/xwords4/android/scripts/adb_uninstall.sh index a20cbeb92..9f7e63434 100755 --- a/xwords4/android/scripts/adb_uninstall.sh +++ b/xwords4/android/scripts/adb_uninstall.sh @@ -10,6 +10,23 @@ usage() { exit 0 } +if [ ! -e build.xml ]; then + usage "No build.xml; please run me from the top android directory" +fi + +DIRNAME=$(basename $(pwd)) +case $DIRNAME in + XWords4-bt) + PKG=xw4bt + ;; + XWords4) + PKG=xw4 + ;; + *) + usage "running in unexpected directory $DIRNAME" + ;; +esac + while [ $# -ge 1 ]; do case $1 in -n) @@ -24,4 +41,4 @@ done SERIAL="$(adb devices | grep 'device$' | sed -n "$((1+INDEX)) p" | awk '{print $1}')" -adb -s $SERIAL uninstall org.eehouse.android.xw4 +adb -s $SERIAL uninstall org.eehouse.android.${PKG}