Skip to content

Instantly share code, notes, and snippets.

@msm81
Created April 4, 2020 14:23
Show Gist options
  • Save msm81/2e9b8e4831c8b32c836fbcbeb1fc70a3 to your computer and use it in GitHub Desktop.
Save msm81/2e9b8e4831c8b32c836fbcbeb1fc70a3 to your computer and use it in GitHub Desktop.
ADB commands to test Doze mode and App Standby in android
Test Doze mode (Idle mode) =>
-> Enable Doze mode (may be required on Emulator)
adb shell dumpsys deviceidle enable
-> Force the system into idle mode
adb shell dumpsys deviceidle force-idle
-> Exit idle mode
adb shell dumpsys deviceidle unforce
-> Reactivate the device
adb shell dumpsys battery reset
------------
Test App Standby =>
-> Force the app into App Standby mode
adb shell dumpsys battery unplug
adb shell am set-inactive <packageName> true
-> Waking app
adb shell am set-inactive <packageName> false
adb shell am get-inactive <packageName>
------------
Get some information about Doze mode on the device =>
-> Dump Doze mode info
adb shell dumpsys deviceidle
-> Get status of Light Doze mode
adb shell dumpsys deviceidle get light
-> Get status of Deep Doze mode
adb shell dumpsys deviceidle get deep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment