+-
                                
                                    
                                
                                
                                    
                                
                                
                                    
                                        
                                        
                                        
                                        
                                        
                                            
                                        
                                        
                                    
                                
                            
                        
  是否有任何Adb命令将音量设置为特定值?我知道我们可以做到 
  
  
 
 
adb shell input keyevent 
 
 音量增大和减小但我想将其设置为特定值.如果我更改它,那么我必须重启设备才能反映更改,所以我不想走那条路.是否有任何API我可以更改值而无需重新启动它并且必须依赖于音量调高和调低?
  最佳答案 
 
  也可以使用media shell命令: 
  
  
 
    
media volume:  the options are as follows: 
    --stream STREAM selects the stream to control, see AudioManager.STREAM_*
                    controls AudioManager.STREAM_MUSIC if no stream is specified
    --set INDEX     sets the volume index value
    --adj DIRECTION adjusts the volume, use raise|same|lower for the direction
    --get           outputs the current volume
    --show          shows the UI during the volume change
examples:
    adb shell media volume --show --stream 3 --set 11
    adb shell media volume --stream 0 --adj lower
    adb shell media volume --stream 3 --get
 
 第一个例子可能是你正在寻找的那个(但在询问时它可能不存在)
  点击查看更多相关文章 
 
转载注明原文:android – ADB命令设置音量? - 乐贴网