Search code examples
androidandroid-emulatorbattery

Can't change battery configuration in Android Emulator


I'm trying to change in my emulator the battery status as capacity and ac status but isn't working.

I made the whole steps:

1) Connected to the emulator via telnet;
2) Tried to use the commands such power ac off and power capacity 70
3) Every time I checked the power display, the same configuration appears and no change I input is save, and the emulator always show the battery with a "!".

FR I saw this link Change emulator battery level in Windows, tried it and nothing resolved.

Follow my data about the battery:

power display
AC: online
status: Not charging
health: Dead
present: false
capacity: 0

Thank you!


Solution

  • It seems like your emulator device has battery option turned off.

    You can change AVD battery configuration through:

    1. Open AVD configuration file:

      Default location for Linux/MAC

      ~/.android/avd/<AVD name>.avd/config.ini
      

      Default location for Windows XP

      C:\Documents and Settings\<user>\.android\avd\<AVD name>.avd\config.ini
      

      Default location for Windows Vista and later

      C:\Users\<user>\.android\avd\<AVD name>.avd\config.ini
      
    2. Change the line:

      hw.battery=no
      

      to

      hw.battery=yes