Changes

Jump to: navigation, search

Mobile/Fennec/Android/GDBNoRoot

1,248 bytes added, 23:55, 20 June 2011
Created page with "It is possible to use gdb '''without''' root on Android 2.3+ devices! *Go to your Android NDK directory and enter /build<br> *Run this:<br> <br> mkdir lib<br>adb push prebu..."
It is possible to use gdb '''without''' root on Android 2.3+ devices!

*Go to your Android NDK directory and enter /build<br>
*Run this:<br>

<br>

mkdir lib<br>adb push prebuilt/linux-x86/arm-eabi-4.4.0/bin/gdbserver /data/local<br>adb shell chmod 755 /data/local/gdbserver<br>for file in $(adb shell ls /system/lib | tr "\n" " " | tr "\r" " "); do<br> adb pull /system/lib/$file lib<br>done<br>adb pull /system/bin/app_process lib<br><br>

*Forward a port, by doing<br>

<br>

adb forward tcp:12345 tcp:12345<br><br>

*Find your pid with<br>

<br>

adb shell ps | grep fennec<br><br>

*Connect to the process on the devices with<br>

<br>

adb shell /data/local/gdbserver :12345 --attach THE_PID_YOU_JUST_FOUND<br>

<br>

*Run gdb with<br>

<br>

./prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gdb ./lib/app_process<br>

<br>

*In gdb, run this or just place it in a .gdbinit (then run just android_attach)<br>

<br>def android_attach<br> set solib-absolute-prefix /builds/android_tools/tegra-gdb-20100902/lib/<br> set solib-search-path<br>/builds/android_tools/tegra-gdb-20100902/lib/:/builds/android_tools/tegra-gdb-20100902/lib/system/lib:/builds/mozilla-central/obj-android/dist/bin/<br> target remote localhost:12345<br>end<br>

<br>
213
edits

Navigation menu