leverglowh
leverglowh

Reputation: 889

How do I change android emulator's battery setting?

I'm trying to change the battery status and level of the AVD (Nexus 5x).
I tried everything in this question but nothing is working.
Setting battery by AVD manager UI (... > battery) works only if I restart the entire emulator but I would want it to change real time so no luck.
Connection to telnet succedes but strangely power settings through telnel don't get synced to the emulator meaning that everything remains in CLI.
Also, AVD config.ini hw.battery=yes is already set.

Upvotes: 2

Views: 1981

Answers (1)

feridok
feridok

Reputation: 658

First enter adb shell:

adb shell

next set your battery to discharging mode:

dumpsys battery set ac 0

now set your battery level to 20%

dumpsys battery set level 20

worked for me when I entered adb shell, and it's not working when I use adb shell dumpsys!

source

Upvotes: 3

Related Questions