本文介绍了如何模拟Android设备的电池电量低的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我怎么可以模拟我的根设备电池电量低?

Can anyone tell me how can I simulate low battery in my rooted device?

我通过了 的问题,但没有找到多少信息这一点。

I gone through this question but did not find much information on this.

推荐答案

模拟电池电量低默认情况下不作为据我所知,(如果你使用Eclipse作为IM)提供。
但如果你是在linux下,ü可以使用telnet连接到本地主机乌尔仿真器和执行权力的行为。(不使用它们也许ü可以给一试)

simulating low battery is not provided by default as far as i know.(if you are using eclipse as im).But if you are in linux , u can use telnet to connect to ur localhost emulator and perform 'Power' actions.(not used them maybe u can give a try)http://handycodeworks.com/?p=46

但你不必须经历这个过程。只需注册为ACTION_BATTERY_LOW广播接收机,它是保证在低电量的情况被称为

But u dont have to go through that process. Just register a broadcast receiver for ACTION_BATTERY_LOW, and it is guaranteed to be called in low battery scenarios.

希望它能帮助

编辑:

下面是直接的答案(假设UR运行Windows)。

here is the direct answer (assuming that ur running windows).

在Windows上启用远程登录,如果你还没有了。

Enable 'telnet' on windows if you havent already.

控制面板 - >程序 - >下的程序和功能,选择启用Windows功能打开或关闭 - >它会打开一个新的窗口中选择远程网客户端,然后单击确定

Control panel-->programs-->under 'programs and features' select 'turn windows features on or off'-->it opens a new window select 'telenet client' and click on OK.

开始拥有管理员权限的命令提示符(所有程序中搜索cmd并右键单击它并选择以管理员身份运行)。

start command prompt with admin rights(in AllPrograms search for 'cmd' and right click on it and select run as admin).

然后使用此命令

1)telnet localhost 5554 //where 5554 is your emulator id, which is displayed top left   corner of ur emulator
2)power capacity 10   //set the battery level to 10%
3)power ac off    //turns off charging mode

现在你可以看到模拟器低电量对话框。

Now you can see a low battery dialog in emulator.

这篇关于如何模拟Android设备的电池电量低的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-30 12:18