add reinstall option

This commit is contained in:
Eric House 2015-06-02 08:04:06 -07:00
parent 802ec24023
commit 8e21c69a55

View file

@ -3,7 +3,9 @@
set -e -u
MANIFEST=AndroidManifest.xml
XWORDS=org.eehouse.android.xw4
INSTALL=''
UNINSTALL=''
CMDS=''
usage() {
@ -12,6 +14,19 @@ usage() {
exit 1
}
uninstall() {
adb devices | while read DEV TYPE; do
case "$TYPE" in
device)
adb -s $DEV uninstall $XWORDS
;;
emulator)
adb -s $DEV uninstall $XWORDS
;;
esac
done
}
while [ $# -gt 0 ]; do
case $1 in
--help|-h|-help|-?)
@ -23,6 +38,10 @@ while [ $# -gt 0 ]; do
install)
INSTALL=1
;;
reinstall)
UNINSTALL=1
INSTALL=1
;;
*)
usage "Unexpected param $1"
;;
@ -53,6 +72,9 @@ esac
ant $CMDS
if [ -n "$UNINSTALL" ]; then
uninstall
fi
if [ -n "$INSTALL" ]; then
adb-install.sh -e -d
fi