Have not seen any commands regarding turning the Android device speakers on using "adb shell", curious if there is a way?
#call phone
adb shell am start -a android.intent.action.CALL -d tel:X-XXX-XXXX
# ******* put speaker on here *******
sleep X
#end call
adb shell input keyevent KEYCODE_ENDCALL
To set Speakerphone on from
adb shell
use:adb shell service call audio 35 i32 1
adb shell service call audio 36 i32 1
adb shell service call audio 30 i32 1
adb shell service call audio 29 i32 1
Replace
1
with0
to set it off.