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.
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
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.
Hope it helps
EDIT:
here is the direct answer (assuming that ur running windows).
Enable 'telnet' on windows if you havent already.
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.
start command prompt with admin rights(in AllPrograms search for 'cmd' and right click on it and select run as admin).
then use this commands
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.