How to debug remote AIDL service in Android?

点点圈 提交于 2020-01-02 07:13:12

问题


I have sources of a remote service which is using AIDL. Also I have my own app that connects to that service. I debug two apps simultaneously, but inside the remote service I can hit breakpoints only in generated AIDL file (stub and proxy), but I can't hit the real methods of the remote service. What can be the reason? Maybe I'm doing something wrong?

Thanks!


回答1:


It's a while since I tried this, but from memory I think what I did was :

I set the breakpoints in the source, started the app which used the remote service, then went to the DDMS perspective and selected the process corresponding to the service. Then clicked on the little green bug icon which enabled the breakpoints to trigger.




回答2:


Put this android.os.Debug.waitForDebugger() in onCreate() of the service and put a break point to a line below. Then in AS press "Attach debugger to Android Process" and double click on the service process to be debugged. New debug session will be created.



来源:https://stackoverflow.com/questions/15640871/how-to-debug-remote-aidl-service-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!