From 10e68aa0080a438006b2c3a3a831f99e7e8bf2dd Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Fri, 21 Jul 2017 19:30:55 -0400 Subject: [PATCH] Update build.sh --- build.sh | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/build.sh b/build.sh index 471172bb9..d57cfc9ab 100755 --- a/build.sh +++ b/build.sh @@ -199,15 +199,20 @@ uninstall_test_apk() { } fetch_images() { - rm -rf tmp/test-screenshots > /dev/null - mkdir -p tmp/ - adb pull /sdcard/Android/data/org.isoron.uhabits/files/test-screenshots tmp/ - adb shell rm -rf /sdcard/Android/data/org.isoron.uhabits/files/test-screenshots + rm -rf tmp/test-screenshots > /dev/null + mkdir -p tmp/ + $ADB pull /mnt/sdcard/test-screenshots/ tmp/ + $ADB pull /storage/sdcard/test-screenshots/ tmp/ + $ADB pull /sdcard/Android/data/${PACKAGE_NAME}/files/test-screenshots/ tmp/ + + $ADB shell rm -r /mnt/sdcard/test-screenshots/ + $ADB shell rm -r /storage/sdcard/test-screenshots/ + $ADB shell rm -r /sdcard/Android/data/${PACKAGE_NAME}/files/test-screenshots/ } accept_images() { - find tmp/test-screenshots -name '*.expected*' -delete - rsync -av tmp/test-screenshots/ uhabits-android/src/androidTest/assets/ + find tmp/test-screenshots -name '*.expected*' -delete + rsync -av tmp/test-screenshots/ uhabits-android/src/androidTest/assets/ } run_local_tests() { @@ -217,7 +222,7 @@ run_local_tests() { build_instrumentation_apk install_test_butler install_apk - uninstall_test_apk + uninstall_test_apk install_test_apk run_instrumented_tests parse_instrumentation_results @@ -249,12 +254,12 @@ case "$1" in Usage: $0 ci-tests AVD_NAME AVD_SERIAL [options] Parameters: - AVD_NAME name of the virtual android device to start - AVD_SERIAL adb port to use (e.g. 5560) + AVD_NAME name of the virtual android device to start + AVD_SERIAL adb port to use (e.g. 5560) Options: - -u --uninstall-first Uninstall existing APK first - -r --release Build and install release version, instead of debug + -u --uninstall-first Uninstall existing APK first + -r --release Build and install release version, instead of debug END exit 1 fi @@ -275,13 +280,13 @@ case "$1" in run_local_tests ;; - fetch-images) - fetch_images - ;; + fetch-images) + fetch_images + ;; - accept-images) - accept_images - ;; + accept-images) + accept_images + ;; install) shift; parse_opts $* @@ -295,11 +300,11 @@ case "$1" in Builds, installs and tests Loop Habit Tracker Commands: - ci-tests Start emulator silently, run tests then kill emulator - local-tests Run all tests on connected device - install Install app on connected device - fetch-images Fetches failed view test images from device - accept-images Copies fetched images to corresponding assets folder + ci-tests Start emulator silently, run tests then kill emulator + local-tests Run all tests on connected device + install Install app on connected device + fetch-images Fetches failed view test images from device + accept-images Copies fetched images to corresponding assets folder Options: -u --uninstall-first Uninstall existing APK first