Android ADB (Android Debug Bridge) Sending broadcast

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


It's possible to send broadcast to BroadcastReceiver with adb.

In this example we are sending broadcast with action and string extra in bundle 'foo'='bar':

adb shell am broadcast -a action --es foo "bar"

You can put any other supported type to bundle, not only strings:

--ez  - boolean
--ei  - integer
--el  - long
--ef  - float
--eu  - uri
--eia - int array (separated by ',')
--ela - long array (separated by ',')
--efa - float array (separated by ',')
--esa - string array (separated by ',')

To send intent to specific package/class -n or -p parameter can be used.
Sending to package:


Sending to a specific component (SomeReceiver class in package):


Useful examples:

Got any Android Question?