Send parameterless broadcast and parameterized broadcast in Android adb or serial port

Execute adb shell am broadcast through the command line to send the broadcast:

No parameter broadcast

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED (this is a boot broadcast)

You participate in the broadcast

adb shell am broadcast -a android.intent.action.BOOT_COMPLETED --es test_name "王大 hammer" --ez test_power false --ei test_age 18 (This is a boot broadcast)

Parameter Description:

--es parameter e represents extra, s represents String type

--ez parameter e represents extra, z represents Boolean type

--ei parameter e represents extra, i represents Int type

If you want to execute it in the serial port, remove the adb shell and just am broadcast -a action.

Guess you like

Origin blog.csdn.net/u012598200/article/details/131894815