Last active
October 15, 2024 14:32
-
-
Save y-polek/febff143df8dd92f4ed2ce4035c99248 to your computer and use it in GitHub Desktop.
adb commands to test Doze mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/zsh | |
# Buttery powered state | |
adb shell dumpsys battery | grep powered | |
# Unplug battery | |
adb shell dumpsys battery unplug | |
# Reset battery | |
adb shell dumpsys battery reset | |
# Dump Doze mode info | |
adb shell dumpsys deviceidle | |
# Enable Doze mode (may be required on Android Emulator) | |
adb shell dumpsys deviceidle enable | |
# Get status of Light Doze mode | |
adb shell dumpsys deviceidle get light | |
# Get status of Deep Doze mode | |
adb shell dumpsys deviceidle get deep | |
# Enter Light Doze mode (should be called several times to pass all phases) | |
adb shell dumpsys deviceidle step light | |
# Enter Deep Doze mode (should be called several times to pass all phases) | |
adb shell dumpsys deviceidle step deep |
I think at that time I did not call step deep
enough times. force idle
felt more convenient because it worked immediately.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the info. Yep I know about dontkillmyapp and don't really have any issues with the apps on my phone, they're all whitelisted and run fine. I'm just trying to force my phone to go into doze mode properly. I know there are apps like ForceDoze and NapTime and some other ones, but I don't the doze profiles that they use and prefer to use my own. I also wanted to use a single app to automate everything (hence using Tasker and MacroDroid) and so the last thing I needed was to force doze mode using either step deep or force idle, but obviously wasn't sure what the difference was between them, until now.
Just to confirm, you mentioned that using step deep that it "does not cause any real deep sleep side effects". So does that mean your phone was in deep sleep and yet it wasn't having any issues? E.g. apps that are whitelisted can still generate notifications, etc?