Can't change battery configuration in Android Emulator

不羁岁月 提交于 2019-12-10 20:44:40

问题


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!


回答1:


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
    



回答2:


You made right. I did it on my computer and sometimes it did not worked too, I just had to set battery status to discharging before setting its capacity.

power status discharging

Additionally there is a nice tutorial that could help you with additional commands:

http://www.stealthcopter.com/blog/2010/07/changing-the-battery-percentage-in-an-avd-android-virtual-device-emulator/



来源:https://stackoverflow.com/questions/22568645/cant-change-battery-configuration-in-android-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!