As many already noticed, the problem manifests itself only if the extra string contains whitespaces.
The root cause is that OP's host OS/shell (i.e. Windows/cmd.exe) mangles the entered command - the "
characters get lost, --es sms_body "test from adb"
becomes --es sms_body test from adb
. Which results in sms_body
string extra getting assigned the value of test
and the rest of the string becoming <URI>|<PACKAGE>|<COMPONENT>
specifier.
To avoid all that you could use:
adb shell "am broadcast -a com.whereismywifeserver.intent.TEST --es sms_body 'test from adb' -n com.whereismywifeserver/.IntentReceiver"
or just start the interactive adb shell
session first and run the am broadcast
command from inside of it.