summaryrefslogtreecommitdiff
path: root/debug.sh
diff options
context:
space:
mode:
authorRafael Gálvez Vizcaíno <rafa@i7>2013-05-27 20:44:03 +0200
committerRafael Gálvez Vizcaíno <rafa@i7>2013-05-27 20:47:05 +0200
commit8cf70d4f69db6326407956a44a54c7fe5530a22c (patch)
treec46d81a7d4e820da505e18b700383aecf028fa83 /debug.sh
parent75edcdb601be69f4c1ee6783cf7f80390a9f094d (diff)
First version of the README and ant build.xml
This is the first commit of this branch. It contains the README file with instructions for different user targets (Compiling, Running on the emulator and Debugging from console), and the ant build.xml file. debug.sh is an experimental script, because it uses "sleep" to synchronize between Emulator and adb install and run. If you want to use it, please look for that "sleep" lines and update their numbers according to your experience.
Diffstat (limited to 'debug.sh')
-rwxr-xr-xdebug.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/debug.sh b/debug.sh
new file mode 100755
index 00000000..c3f96ba0
--- /dev/null
+++ b/debug.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+if [ -z "$2" ]
+then
+ echo Usage: debug.sh \"avd name\" \"project folder\"
+ exit 0;
+fi
+avd_name=$1
+PROJECT_FOLDER=$2
+localport=`expr $RANDOM % 65536`
+
+emulator -wipe-data @$avd_name & # If you want to test the app from scratch
+sleep 70
+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
+pid=`adb shell ps | grep leap | awk '{print $2}'` # Identify the process id (pid) of the current leapclient process instance
+adb forward tcp:$localport jdwp:$pid
+sleep 3
+jdb -sourcepath $PROJECT_FOLDER/src/ -attach localhost:$localport