Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug remote AIDL service in Android?

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!

like image 808
Taras Avatar asked Oct 22 '25 15:10

Taras


2 Answers

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.

like image 58
sbuslovsky Avatar answered Oct 25 '25 04:10

sbuslovsky


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.

like image 36
NickT Avatar answered Oct 25 '25 04:10

NickT