Android Wakelock troubleshooting - identifying the app that is preventing the phone from going into sleep mode and fast draining the battery

0
=
0
+
0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
0

My Nexus 5 sometimes drains from 100% chage to zero overnight. This only happens occasionally, and I am assuming some of the apps is not properly handing Android wakelock preventing phone from going to sleep. This assumption is confirmed by the following screenshot (Android KitKat 4.4.4). It shows 9 hrs of "keep awake" time and only 19 minutes of "CPU total" time.

Question: how to find out what app is holding that wake lock preventing the phone from going into sleep mode? Thanks!

System > Settings > Battery > Android OS

identifying-android-wakelock-battery-drain-problem

Tags: ,

1 Answer

1
=
0
=
$0
Internet users could send Bitcoin Tips to you if they like your answer!

Here is a great article that explains how to troubleshoot Android wakelock problems. Below is an excerpt from that article:

To identify if any wakelocks still held after an application has been put into background, follow this process:

  1. Connect the device to USB.
  2. Launch the application and play with it.
  3. Press the power button to go to sleep mode or exit the application in some other way.
  4. Wait for about 30 sec.
  5. Type the following instruction in command line:

    adb shell dumpsys power

  6. Check if there are any PARTIALWAKELOCKs like this one for example: PARTIALWAKELOCK ‘AudioOut_2’ activated(minState=0, uid=1013, pid=157)

  7. Repeat step 5 every 30 sec 3 to 5 times. If the result stays the same, there may be an issue with improper wakelock handling by the app with given pid .

SEND BITCOIN TIPS
1

Too many commands? Learning new syntax?

FavScripts.com is a free tool to save your favorite scripts and commands, then quickly find and copy-paste your commands with just few clicks.

Boost your productivity with FavScripts.com!

Post Answer