From 524a2889994efb7761e2afc5f310e60db9ebaf9b Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 26 Jul 2016 22:08:29 -0700 Subject: [PATCH] change adb utility scripts so they work with more than just one set of apps. --- xwords4/android/scripts/adb-install.sh | 17 ++--------------- xwords4/android/scripts/adb-uninstall.sh | 4 ++-- xwords4/android/scripts/find-and-ant.sh | 4 +++- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/xwords4/android/scripts/adb-install.sh b/xwords4/android/scripts/adb-install.sh index 950ae65ce..5c3cc4c0d 100755 --- a/xwords4/android/scripts/adb-install.sh +++ b/xwords4/android/scripts/adb-install.sh @@ -18,20 +18,7 @@ DIRNAME=$(basename $(pwd)) ADB="$(which adb)" MAIN=MainActivity -case $DIRNAME in - XWords4-dbg) - PKG=xw4dbg - ;; - XWords4-bt) - PKG=xw4bt - ;; - XWords4) - PKG=xw4 - ;; - *) - usage "running in unexpected directory $DIRNAME" - ;; -esac +PKG=$(xmlstarlet sel -T -t -m "/manifest" -v @package -n AndroidManifest.xml) while [ $# -ge 1 ]; do case $1 in @@ -76,7 +63,7 @@ for DEVICE in $DEVICES; do ls -l $APK $ADB -s $DEVICE install -r $APK $ADB -s $DEVICE shell am start \ - -n org.eehouse.android.${PKG}/org.eehouse.android.${PKG}.${MAIN} + -n ${PKG}/${PKG}.${MAIN} done COUNT=$((COUNT+1)) done diff --git a/xwords4/android/scripts/adb-uninstall.sh b/xwords4/android/scripts/adb-uninstall.sh index 672107820..07450b18c 100755 --- a/xwords4/android/scripts/adb-uninstall.sh +++ b/xwords4/android/scripts/adb-uninstall.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e -u -x +set -e -u # use this: adb -s 04bd25af2523aae6 shell "pm list packages" | grep org.eehouse @@ -17,7 +17,7 @@ usage() { echo " [--apk ] # default is to use package names of all known apks" echo " [--pkg-name tld.whatever.more] # explicit package name" echo " [--serial ] # default is to use all attached devices" - echo "uninstall crosswords variant" + echo "uninstall apps based on known .apk or package name" exit 1 } diff --git a/xwords4/android/scripts/find-and-ant.sh b/xwords4/android/scripts/find-and-ant.sh index ca402e94a..92858016f 100755 --- a/xwords4/android/scripts/find-and-ant.sh +++ b/xwords4/android/scripts/find-and-ant.sh @@ -72,7 +72,9 @@ esac # if we're running for the first time in this directory/variant, # generate local.properties -[ -e local.properties ] || ../scripts/setup_local_props.sh +if [ -e ../scripts/setup_local_props.sh ]; then + [ -e local.properties ] || ../scripts/setup_local_props.sh +fi # If this fails, the "set -e" above means we won't try to install anything [ -n "$CMDS" ] && ant $CMDS