diff --git a/OsmAnd/ndebug.sh b/OsmAnd/ndebug.sh new file mode 100755 index 0000000000..ecce3d83c1 --- /dev/null +++ b/OsmAnd/ndebug.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Get pid of our process +pid=`adb shell ps | grep 'net.osmand' | head -n1 | awk '{print $2}'` +package=`adb shell ps | grep 'net.osmand' | head -n1 | awk '{print $9}'` +echo "OsmAnd package: $package" +echo "OsmAnd pid: $pid" + +# Launch gdbserver on target +adb shell run-as $package /data/data/$package/lib/gdbserver :5039 --attach $pid & + +# Launch gdb on host +"$ANDROID_NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-gdb" \ No newline at end of file