Search code examples
androidandroid-intentadb

adb reboot broadcast doesn't work on some app


I've used this question to test reboot broadcast of my own app. i.e.,

C:\Eclipse\sdk\platform-tools>adb shell am broadcast -a
 android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME
 -n my.own.app/.BRAutoStart Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED
cat=[android.intent.category.HOME] cmp=my.own.app/.BRAutoStart }



 Broadcast completed: result=0

but it doesn't work.

The simple command reboots the device:

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c
android.intent.category.HOME

I know that broadcast receiver BRAutoStart receives the boot_completed , because i've tested it and using it in production code.

I'm using the real device, not an emulator.

How to setup command line to send the broadcast to the device?


Solution

  • You can try this call:

    adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n your.app.packagename/.YourReceiverClassName
    

    it won't reboot your device but send broadcast to your receiver