I run android system on my linux with emulator, and now I want to debug android runtime(ART).
I can debug through the following methods now:
- first replace the system's libart with debug_info library.
emulator
adb root
adb remount
adb push ~/android/library/libart.so /system/lib/libart.so
- Then perform port forwarding within the Android system, and use gdbserver to listen within the Android system, using calendar applications as an example:
adb forward tcp:2345 tcp:2345
adb shell gdbserver 10.0.2.2:2345 am start -n com.android.calendar/com.android.calendar.LaunchActivity
- Use gdb to connect to gdbserver in host system and debug libart:
target remote :2345
dir ~/android/aosp/
b JNI_CreateJavaVM
r
But debugging ART in this way is very inconvenient. Is there a better debug method available?