adb shell am broadcast 发送广播通知,在程序中使用

adb shell am broadcast 参数

[-a <ACTION>]
[-p <PKG>]
[-d <DATA_URI>] 
[-t <MIME_TYPE>]
[-c <CATEGORY> [-c <CATEGORY>] ...]
[-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
[--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
[--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
[--exclude-stopped-packages]
[--include-stopped-packages]
例如:

adb shell am broadcast -a com.android.test -p com.android.test --es test_string "this is test string" --ei test_int 100 --ez test_boolean true

说明:蓝色为key,红色为alue,分别为String类型,int类型,boolean类型

继续阅读adb shell am broadcast 发送广播通知,在程序中使用