Skip to content
David Weinstein edited this page Feb 23, 2013 · 1 revision

Use JDB to Trace Android Application

#!/bin/bash
TARGET=$1 # e.g., org.jfedor.frozenbubble/.FrozenBubble &
adb wait-for-device
adb shell am start \
    -e debug true \
    -a android.intent.action.MAIN \
    -c android.intent.category.LAUNCHER \ 
    -n ${TARGET} &

debug_port=$(adb jdwp | tail -1);

  adb forward tcp:29882 jdwp:$debug_port &
jdb -J-Duser.home=. -connect \ com.sun.jdi.SocketAttach:hostname=localhost,port=29882 &

Clone this wiki locally