summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebug.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/debug.sh b/debug.sh
index c3f96ba0..18679368 100755
--- a/debug.sh
+++ b/debug.sh
@@ -9,11 +9,25 @@ avd_name=$1
PROJECT_FOLDER=$2
localport=`expr $RANDOM % 65536`
+wait_until_booted() {
+ OUT=`adb shell getprop init.svc.bootanim`
+ RES="stopped"
+
+ while [[ ${OUT:0:7} != 'stopped' ]]; do
+ OUT=`adb shell getprop init.svc.bootanim`
+# echo 'Waiting for emulator to fully boot...'
+ sleep 5
+ done
+
+ echo "Emulator booted!"
+}
+
emulator -wipe-data @$avd_name & # If you want to test the app from scratch
-sleep 70
+wait_until_booted
adb install -r $PROJECT_FOLDER/bin/LEAP\ Android-debug.apk # Install the new version of the application
adb shell am start -D se.leap.leapclient/.Dashboard # Run app
+sleep 1
pid=`adb shell ps | grep leap | awk '{print $2}'` # Identify the process id (pid) of the current leapclient process instance
+echo forwarding tcp:$localport to jwdp:$pid
adb forward tcp:$localport jdwp:$pid
-sleep 3
jdb -sourcepath $PROJECT_FOLDER/src/ -attach localhost:$localport