0

Is there any adb command to know the current volume level of android device?

I find this somewhere: sqlite3 /data/data/com.android.providers.settings/databases/settings.db "select * from system where name like '%volume%';"

but it's throwing following error: Error: unable to open database "/data/data/com.android.providers.settings/databases/settings.db": unable to open database file

  • Is your device rooted? You have to be rooted to access the /data partition directly.. – Gokul NC Jul 7 '16 at 12:44
  • Yes, my device is rooted. I am able to do other tasks for which device is required to be rooted. – Yogesh Tyagi Jul 7 '16 at 15:14
  • Ensure manually using a file explorer if there's a file named settings.db under /data/data/com.android.providers.settings/databases/ directory.. – Gokul NC Jul 7 '16 at 15:49
  • No. it's not there. Neither I could find it using find command. Is there some other way to get volume level? – Yogesh Tyagi Jul 8 '16 at 3:11
  • settings.db is removed since Marshmallow I guess. And also, this command seemed to work till JellyBean or something: settings get system volume_music. It returns some other irrelevant value now.. – Gokul NC Jul 8 '16 at 11:30
2

Use command adb shell dumpsys audio. It will list all the volume related information. e.g for alarm volume look for STREAM_ALARM in output logs.

- STREAM_ALARM:
    Muted: false
    Min: 0
    Max: 7
    Current: 2 (speaker): 7, 40000000 (default): 6
    Devices: speaker 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.