From ea3347ad4a8b2d478ab1ea2ea1fa19ffc5d695a2 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 5 Dec 2013 07:47:13 -0800 Subject: [PATCH] fix to install and launch based on location run from --- xwords4/android/scripts/install-all.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/xwords4/android/scripts/install-all.sh b/xwords4/android/scripts/install-all.sh index 45c03aeb9..95b9cc354 100755 --- a/xwords4/android/scripts/install-all.sh +++ b/xwords4/android/scripts/install-all.sh @@ -2,14 +2,30 @@ set -u -e -APK=./bin/XWords4-debug.apk - usage() { [ $# -ge 1 ] && echo "Error: $1" echo "usage: $(basename $0) [-e|-d] [-p /path/to/.apk]" exit 1 } +if [ ! -e build.xml ]; then + usage "No build.xml; please run me from the top android directory" +fi + +APK=./bin/XWords4-debug.apk +DIRNAME=$(basename $(pwd)) +case $DIRNAME in + XWords4-bt) + PKG=xw4bt + ;; + XWords4) + PKG=xw4 + ;; + *) + usage "running in unexpected directory $DIRNAME" + ;; +esac + DEVICES='' while [ $# -ge 1 ]; do @@ -48,7 +64,7 @@ for DEVICE in $DEVICES; do echo $DEVICE adb -s $DEVICE install -r $APK adb -s $DEVICE shell am start \ - -n org.eehouse.android.xw4/org.eehouse.android.xw4.GamesList + -n org.eehouse.android.${PKG}/org.eehouse.android.${PKG}.GamesList COUNT=$((COUNT+1)) done