[英]How can I debug Android platform java files?
I'm interested in learning more about certain Android services (ie: ActivityManager, PackageManager, etc). 我有兴趣进一步了解某些Android服务(例如:ActivityManager,PackageManager等)。 So, I would like to follow their (java code only for now) execution, place breakpoints, etc. Is this possible either on the emulator or on a target device?
因此,我想遵循它们的执行(仅Java代码),放置断点等。这可能在模拟器上还是在目标设备上?
Edit: for instance, some PackageManager (AOSP code) is at services/java/com/android/ server/pm/PackageManagerService.java. 编辑:例如,某些PackageManager(AOSP代码)位于services / java / com / android / server / pm / PackageManagerService.java。 I realize this ultimately becomes a thread of system_server.
我意识到这最终成为system_server的线程。
I have root (in both emulator and on my physical phone) and I think that I should be able to build these services from AOSP source. 我有root用户(在模拟器和物理电话中都有),我认为我应该能够从AOSP源构建这些服务。
I'm happy to work via logs (logfiles, logcat, etc) or via actual debugging tools (gdb, eclipse, etc). 我很高兴通过日志(日志文件,logcat等)或通过实际的调试工具(gdb,eclipse等)进行工作。 What works best?
什么最有效? Should I just add log messages to everything or can I somehow hook up an IDE on my PC so I can drill down into elements, look at the stack, etc?
我应该只向所有内容添加日志消息,还是可以以某种方式在PC上连接IDE,以便深入研究元素,查看堆栈等?
most phone not build from AOSP, and can replace the parts with AOSP built ones. 大多数电话不是使用AOSP构建的,而是可以使用AOSP内置的部件来替换这些部件。 so to use emulator is better.
所以使用模拟器更好。
Good Luck. 祝好运。 it is a Big Work for you :)
这对您来说是一项艰巨的工作:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.