Skip to content

Instantly share code, notes, and snippets.

@y-polek
Last active February 8, 2024 04:32
Show Gist options
  • Star 58 You must be signed in to star a gist
  • Fork 23 You must be signed in to fork a gist
  • Save y-polek/febff143df8dd92f4ed2ce4035c99248 to your computer and use it in GitHub Desktop.
Save y-polek/febff143df8dd92f4ed2ce4035c99248 to your computer and use it in GitHub Desktop.
adb commands to test Doze mode
#! /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
@progmars
Copy link

progmars commented Oct 4, 2022

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