How do you turn on device speakers for Android using adb shell

折月煮酒 提交于 2020-01-15 12:44:19

问题


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.



来源:https://stackoverflow.com/questions/25924801/how-do-you-turn-on-device-speakers-for-android-using-adb-shell

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!