adb设置音量

2020-12-19  本文已影响0人  庄周幻梦

Android 11之前

Android 10 方案

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方案

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

上一篇 下一篇

猜你喜欢

热点阅读