Android 10、11 adb 设置音量/修改具体项目的音量

本文介绍了如何使用adb shell命令在Android 10和11上设置音量,包括媒体音量的调整,并给出了不同版本系统的具体操作差异。同时,文章提到了在Android 11中,当设备处于勿扰模式时,adb调节铃声音量的限制。
摘要由CSDN通过智能技术生成

目录

Android 10 方案

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

各项的详细设置

--stream 详细参数,详情看这里

具体用法:

Android 11方案

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

参数用法详细解释看这里 

streamType参数,详情看这里

具体的方法列表看这里

注:

 至于怎么获取音量,这里给一种方式

获取各项音量相关的字段

具体获取各项的音量


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
    /* The audio stream for phone calls */
    public static final int STREAM_VOICE_CALL = 0;
    /* The audio stream for system sounds */
    public static final int STREAM_SYSTEM = 1;
    /* The audio stream for the phone ring and message alerts */
    public static final int STREAM_RING = 2;
    /* The audio stream for music playback */
    public static final int STREAM_MUSIC = 3;
    /* The audio stream for alarms */
    public static final int STREAM_ALARM = 4;
    /* The audio stream for notifications */
    public static final int STREAM_NOTIFICATION = 5;
    /* @hide The audio stream for phone calls when connected on bluetooth */
    public static final int STREAM_BLUETOOTH_SCO = 6;
    /* @hide The audio stream for enforced system sounds in certain countries 
(e.g camera in Japan) */
    public static final int STREAM_SYSTEM_ENFORCED = 7;
    /* @hide The audio
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值