0

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?

Messias Lima
  • 171
  • 7
  • For this kind of thing I just use log output to debug. Put something unique in all debug log entries, and grep for that. – Daniel Nugent Jul 05 '16 at 02:25

2 Answers2

1

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.

Ken Ratanachai S.
  • 3,307
  • 34
  • 43
0

You can test via

Community
  • 1
  • 1
F43nd1r
  • 7,690
  • 3
  • 24
  • 62