How do you turn on device speakers for Android usi

2019-08-02 17:15发布

问题:

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

回答1:

To set Speakerphone on from adb shell use:

  • in Android 4.4.4: adb shell service call audio 35 i32 1
  • in Android 5.1.0: adb shell service call audio 36 i32 1
  • in Android 6.0.1: adb shell service call audio 30 i32 1
  • in Android 7.0+: adb shell service call audio 29 i32 1

Replace 1 with 0 to set it off.



标签: android adb