You need your BroadcastReceiver to have this in the manifest:
android:process=":remote"
Put this in your onReceive method:
android.os.Debug.waitForDebugger();
Then run the project. After that, click "Attach the debugger to the Android process" and wait until your process appears (it will have this name: your.package.name:remote ). Select your process, then click OK and start debugging.

hiddeneyes02
source share