Change emulator battery level in Windows

后端 未结 3 1207
灰色年华
灰色年华 2020-12-21 00:21

How can I change the battery level (from 50% to 70% and not charging) on emulator in Windows OS? There are some guides, but all of them are for Ubuntu.

相关标签:
3条回答
  • 2020-12-21 00:52

    If you are using a remote emulator, like android x86 you can use the following:

    adb connect

    adb shell dumpsys battery set level 90

    0 讨论(0)
  • 2020-12-21 00:52

    I'm using Google's Android emulator with Android Studio on a Windows 10 machine. It is really easy to change the battery status or battery charged level from UI of the emulator. Only catch is that the settings are not present on the main tool bar but it is hidden. Here is how to reach it:

    Click on three dots at the bottom of the tool bar to open extended controls window:

    On the extended controls window, click battery in left navigation bar and whoa! You've got every setting related to battery of the emulator in right pane:

    Battery status field is a drop down list with below values:

    1. Unknown
    2. Charging
    3. Discharging
    4. Not charging
    5. Full

    You can set it to any value of your choice while debugging your app.

    0 讨论(0)
  • 2020-12-21 00:57

    Windows supports telnet from the command prompt, at least on XP and Vista. If you do not find this program on other Windows versions, you can perhaps install PuTTY.

    Then, you telnet into the emulator the same way that you would on any other development OS:

    telnet localhost 5554
    

    where 5554 is the port number given in the title bar of your emulator window.

    From there, it's how the rest of the instructions that you have read describe it. For example, to set the power to 70%, execute the power capacity 70 command in the telnet session. There are other power subcommands outlined in the documentation.

    0 讨论(0)
提交回复
热议问题