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
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
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
The code for setStreamVolume in android 11 is 10. So, you can set the volume using below command -
adb shell service call audio 10 i32 3 i32 <required volume>
Example:
adb shell service call audio 10 i32 3 i32 15
For me, 0 is min volume and 15 is max volume.