Android|MIUI10.2.6 adb 调节屏幕亮度


在调试和自动化测试时,需要自动调节Android的屏幕调度,借助adb可以实现.

获取屏幕亮度范围

adb shell "dumpsys power | grep mScreenBrightnessSetting"
  mScreenBrightnessSetting=0
  mScreenBrightnessSettingMinimum=7
  mScreenBrightnessSettingMaximum=2048
  mScreenBrightnessSettingDefault=536

可以看到最小是7, 最大2048跟某些文章上说的最大255不一致

获取当前亮度

adb shell settings get system screen_brightness
204

设置屏幕亮度

adb shell settings put system screen_brightness 2048

相关博文

About rainbird

IOS攻城狮
This entry was posted in Android and tagged , , , , , , , , , , , , , . Bookmark the permalink.

发表评论