I am currently debugging an application that should auto-start after the device boots. To this end I have created a BroadcastReceiver
and added it to my AndroidManifest.xml
:
<receiver android:name=".receiver.StartupBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
This works all of the time on most devices. On one device however (an MXQ Pro set-top box) it only works most of the time. So far, I have not been able to find any patterns in when it works and when it does not.
So, I would like to find out which BroadcastReceivers are actually, currently registered with the system to receive the BOOT_COMPLETED Intent.
I played around a bit with
pm
: but this only tells me which packages would like to receive the Intentdumpsys
: but its output is overwhelming and I don't know what to look forThanks for any advice!
If you just need to confirm that some specific receiver was properly registered (i.e. you care only about receivers in some specific package you know name of) then just use dumpsys package my.package.name
like @pskink suggested in the comments.
But if you indeed want to know all the receivers system-wide receiving some specific intent - since Android 7.0 you can use
adb shell cmd package query-receivers --brief -a android.intent.action.BOOT_COMPLETED
Remove the --brief
parameter if you want more details. And to list just the names:
adb shell cmd package query-receivers --components -a android.intent.action.BOOT_COMPLETED
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With