Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
589 views
in Technique[技术] by (71.8m points)

java - adb command to set volume of android 11 device

I want to set volume of Android 11 device via adb command to 5.Does anyone know such commands?

Below command works well for Android 8,9,10 but fails to work for Android 11.

adb -s <deviceId> shell media volume --show --stream 3 --set 5
question from:https://stackoverflow.com/questions/65843821/adb-command-to-set-volume-of-android-11-device

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I don't sure struct of "media volume" via command. But in android 11, you can using below command:

  adb shell service call audio 10 i32 'x' i32 0 i32 1

Ex: adb shell service call audio 10 i32 3 i32 0 i32 1


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...