Wakelocks in Android prevent the CPU from entering deep sleep states when background tasks (like audio playback or location tracking) require execution. Controlling wakelocks from ADB shell enables power consumption testing.

ADB Wakelock Commands

ADB Commandsbash
# Inspect active wakelocks holding device awake
adb shell dumpsys power | grep -i "wakelock"
 
# Forcefully acquire a partial wakelock via cmd shell
adb shell cmd wakelock acquire test_wakelock
 
# Release acquired wakelock
adb shell cmd wakelock release test_wakelock