You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
515 B

#!/bin/bash
set -eo pipefail
cd "$(dirname "$0")"
export ANDROID_HOME="${ANDROID_HOME:-/home/user/android}"
echo "Building..."
TMP=$(mktemp)
./gradlew clean > /dev/null 2>&1
if ! ./gradlew assembleDebug > "$TMP" 2>&1; then
cat "$TMP"
rm -f "$TMP"
exit 1
fi
rm -f "$TMP"
echo "Build OK"
if [ "$1" != "noinstall" ]; then
DEV=${1:-$(adb devices 2>/dev/null | awk 'NR==2{print $1}')}
ADB=adb; [ -n "$DEV" ] && ADB="adb -s $DEV"
$ADB install -r app/build/outputs/apk/debug/app-debug.apk
echo "Install OK"
fi