From 232a5bbf3e4055a1f34e20737fd9abef93686072 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 9 Oct 2015 19:41:05 +0200 Subject: [PATCH 1/1] compile_and_run_app.sh: adapt to the gradle project layout --- compile_and_run_app.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compile_and_run_app.sh b/compile_and_run_app.sh index 306d535..922ccba 100755 --- a/compile_and_run_app.sh +++ b/compile_and_run_app.sh @@ -14,10 +14,10 @@ else { echo "Install either xmllint or the XML::XPath perl module" 1>&2; exit 1; } fi -APP_NAME=$($XPATH "string(//project/@name)" build.xml) -PACKAGE=$($XPATH "string(//manifest/@package)" AndroidManifest.xml) -MAIN_ACTIVITY=$($XPATH "string(//activity[1]/@*[local-name() = 'name'])" AndroidManifest.xml) +APP_NAME=$($XPATH "string(//string[@name = 'app_name'])" src/main/res/values/strings.xml) +PACKAGE=$($XPATH "string(//manifest/@package)" src/main/AndroidManifest.xml) +MAIN_ACTIVITY=$($XPATH "string(//activity[1]/@*[local-name() = 'name'])" src/main/AndroidManifest.xml) -ant debug -adb -s emulator-5554 install -r bin/${APP_NAME}-debug.apk +./gradlew assembleDebug +adb -s emulator-5554 install -r build/outputs/apk/${APP_NAME}-debug.apk adb -s emulator-5554 -e shell am start -a android.intent.action.MAIN -n ${PACKAGE}/${PACKAGE}.${MAIN_ACTIVITY} -- 2.1.4