美文网首页
adb设置音量

adb设置音量

作者: 庄周幻梦 | 来源:发表于2020-12-19 18:39 被阅读0次

    Android 11之前

    Android 10 方案

    • 设置媒体音量为0可以设置为:

      adb shell media volume --set 0
      
    • 各项的详细设置

    adb shell media volume --show --stream 4 --set 1[v] will control stream=4 (STREAM_ALARM)[v] will set volume to index=1[v] Connecting to AudioService
    

    Android 11方案

    • 设置媒体音量为0可以设置为:

    adb shell service call audio 10 i32 3 i32 0 i32 1Result: Parcel(00000000    '....')
    
    # coding:UTF-8
    import os
    import time
    
    devices = ['dasodahd', , 'du1eoqhdhd']
    
    while True:
        for device in devices:
            cmd = f'adb -s {device} shell service call audio 10 i32 3 i32 0 i32 1'
            cmd2 = f'adb -s {device} shell  service call audio 10 i32 4 i32 0 i32 1'
            cmd3 = f'adb -s {device} shell svc wifi disable'
            os.popen(cmd)
            os.popen(cmd2)
            os.popen(cmd3)
        time.sleep(30)
    
    

    参考文章:https://blog.csdn.net/xcjean/article/details/103091155

    相关文章

      网友评论

          本文标题:adb设置音量

          本文链接:https://www.haomeiwen.com/subject/tcpcnktx.html