Turn the speakerphone on a call using ADB shell I'm trying to find a command in adb shell that lets me turn on the speakerphone when I start a call.

First I make the call

adb shell service call phone 1 s16 "" s16 "#####"


the call starts and I try to start the speakerphone with something like this: 

adb shell input keyevent &lt;keycode&gt;
You can use combination of keyevents to achieve the goal. The important ones you would need are:

19 --&gt;  "KEYCODE_DPAD_UP" 
20 --&gt;  "KEYCODE_DPAD_DOWN" 
21 --&gt;  "KEYCODE_DPAD_LEFT" 
22 --&gt;  "KEYCODE_DPAD_RIGHT" 
23 --&gt;  "KEYCODE_DPAD_CENTER" 
24 --&gt;  "KEYCODE_VOLUME_UP" 
25 --&gt;  "KEYCODE_VOLUME_DOWN"
66 --&gt;  "KEYCODE_ENTER" 


See ADB Shell Input Events for more.

According to the interface of your dialer, the combination would vary. E.g.:

adb shell input keyevent 20
adb shell input keyevent 21
adb shell input keyevent 21
adb shell input keyevent 66


It may take more steps, and sometimes, you won't get to see whether it affected the interface or not, but continue combining them, and you would get the result. 



That aside, the technique mentioned by Bo Lawson here and taken from this answer by Omar 


  adb shell service call audio 7 i32 3 i32 0 i32 1


isn't working on my Lollipop at all. Neither it is switching the call into speaker, but adjusting the volume of the earphones only in my Kitkat 4.4.2.

Also, if you intend to use a service call method and the linked answer isn't working, then you may wanna take a look at the source code of the audio service to figure out the things. Find it here.