How to set brightness through ADB on nexus 7
Asked Answered
K

5

13

I found some info on the web:

echo 1 /sys/devices/platform/flashlight.0/leds/flashlight/brightness

But on my Nexus 7 (flashed an AOSP), I couldn't find that directory.

Any idea about which file should I write to? Is this doable?

After ls /sys/devices/platform, I got:

LID
alarm
arm-pmu.0
bcm4330_rfkill
bcmdhd_wlan.1
bluesleep
fiq_debugger.0
fsl-tegra-udc
gpio-keys.0
grouper_misc
leds-gpio
oprofile-perf.0
power
power.0
pwm-backlight
ram_console
reg-dummy
reg-fixed-voltage.1
reg-fixed-voltage.10
reg-fixed-voltage.11
reg-fixed-voltage.2
reg-fixed-voltage.3
reg-fixed-voltage.4
reg-fixed-voltage.6
reg-fixed-voltage.8
regulatory.0
sdhci-tegra.2
sdhci-tegra.3
serial8250
snd-soc-dummy
spdif-dit.0
spdif-dit.1
spi_tegra.0
spi_tegra.3
tegra-ehci.1
tegra-i2c.0
tegra-i2c.1
tegra-i2c.2
tegra-i2c.3
tegra-i2c.4
tegra-nvmap
tegra-otg
tegra-pcm-audio
tegra-se
tegra-snd-rt5640.0
tegra30-ahub
tegra30-dam.0
tegra30-dam.1
tegra30-dam.2
tegra30-hda
tegra30-i2s.1
tegra30-i2s.3
tegra30-i2s.4
tegra30-spdif
tegra_camera
tegra_pwm.0
tegra_rtc
tegra_smmu
tegra_uart.1
tegra_uart.2
tegra_uart.3
tegra_uart.4
tegra_wdt
uevent
Koski answered 10/6, 2013 at 14:23 Comment(2)
Try pwm-backlight! (just a guess)Earwitness
@Earwitness Good guess! I found it there. Thanks!Koski
E
0

You should use the pwm-backlight!

Earwitness answered 10/6, 2013 at 18:58 Comment(2)
Can you please provide a full command example of how to use it?Improve
I don't have a Nexus 7 to test it, but it should be something like this: adb shell "echo 1 > /sys/devices/platform/pwm-backlight"Earwitness
S
42

There is a new binary shipping with Android Jellybean 4.2, which can be used to directly read/write to the system settings provider, accessible via command line.

For example: in order to increase brightness of the screen, use below command:

adb shell settings put system screen_brightness 200

Read more about SCREEN_BRIGHTNESS Note that the range of values is [0 - 255]

Sarpedon answered 30/1, 2015 at 18:27 Comment(5)
You saved me, thanks! Is there a place where i can found commands like this one?Radiculitis
For more settings: settings list namespace. ('namespace' is one of {system, secure, global}, case-insensitive.)Coastguardsman
additionally settings put system screen_brightness_mode 0 may be neededHuda
Godlike answer.Featherbedding
This command doesn't work on my Sony XBR X850G Android TV. Hmmmm.Pomfrey
A
3

The range of values is not necessarily from 0 - 255. On my OnePlus for example it ranges from 0-2047. If you want to know yours just set the brightness slider to max and then type: adb shell settings get system screen_brightness.

Archaism answered 3/2, 2021 at 17:47 Comment(0)
B
3

You can use this adb command to set screen brightness

adb shell settings put system screen_brightness 255

and if your device has auto brightness setting then use this command first

adb shell settings put system screen_brightness_mode 0
Buhler answered 20/12, 2021 at 10:13 Comment(0)
E
0

You should use the pwm-backlight!

Earwitness answered 10/6, 2013 at 18:58 Comment(2)
Can you please provide a full command example of how to use it?Improve
I don't have a Nexus 7 to test it, but it should be something like this: adb shell "echo 1 > /sys/devices/platform/pwm-backlight"Earwitness
A
0

This did not work for the latest Nexus 7 (2013) for me. But this answer explains the way to find what you are looking for on any version: https://stackoverflow.com/a/13492336

However we need to note that in order to change any of this you need to have root access.

Aer answered 13/10, 2013 at 12:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.