saras February 2016
Is there a way to check if Android device screen is locked via adb?
I know that PowerManager and/or KeyguardManager can help me check if a device screen is locked/unlocked. Is there a way to check this via adb?
Bryan February 2016
This command will output everything relating to power for the device:
adb shell dumpsys power
You can pipe this to a grep to get the values of
adb shell dumpsys power | grep 'mHolding'
If both are false, the display is off.
mHoldingWakeLockSuspendBlocker is false, and
mHoldingDisplaySuspendBlocker is true, the display is on, but locked.
If both are true, the display is on.
rupesh jain February 2016
If its a rooted phone you can check some fields related to lock in settings.db.
settings.db is located at
Alex P. February 2016
Why not just use
adb command would be:
adb shell service call power 12
Asked in February 2016
Viewed 1,145 times
Answered 3 times
Leave an answer
Quote of the day: live life