How to debug a broadcastreceiver that receive a RECEIVE_BOOT_COMPLETED intent filter?


I need to debug an application that have a BroadcastReceiver that triggers when the device turns on. But Android Studio loses the connection when I turn off the smartphone. How to debug in this case? There's a way to do that?


You can test via

By : F43nd1r

You can simulate a system broadcast using ADB shell's am command in your terminal.

$ adb shell
$ am broadcast -a android.intent.action.BOOT_COMPLETED

Your emulator/device will be rebooted while it still connected with Android Monitor. Note that you cannot simulate Local broadcast, though.

This video can help you solving your question :)
By: admin