Home » Android » android – Obtain screen status using ADB

android – Obtain screen status using ADB

Posted by: admin June 15, 2020 Leave a comment


I need to know in my script whether or not the device’s screen is off. Is there any simple command to obtain such information using ADB?

How to&Answers:

dumpsys power | grep mScreenOn


On 5.0 it looks like you have to grep the dumpsys power output for

Display Power: state=OFF


Display Power: state=ON


On Moto G5+, Moto X4, and Samsung Note 8 I’m seeing the following to work whereas dumpsys power did not (all devices are Marshmallow or later):

adb shell dumpsys deviceidle | grep mScreenOn



when the screen is ‘locked’ whether blank or not, whereas,

adb shell dumpsys window | grep mScreenOn


mScreenOnEarly=false mScreenOnFully=false

only if the screen is not ‘breathing’ info such as the time.

Use dumpsys deviceidle to know if the screen needs to be unlocked to allow user interaction.


  • My Phone: XiaoMi 9
    • Android: 10

use adb to check screen status ON/OFF ?

method 1: use mHoldingDisplaySuspendBlocker

  • Command: adb shell dumpsys power | grep mHoldingDisplaySuspendBlocker
  • Output:
    • mHoldingDisplaySuspendBlocker=false -> Screen OFF
    • mHoldingDisplaySuspendBlocker=true -> Screen ON

method 2: use mWakefulness

  • Command: adb shell dumpsys power | grep mWakefulness=
  • Output:
    • mWakefulness=Dozing -> Screen OFF
    • mWakefulness=Awake -> Screen ON

method 3: use nfc (if android has NFC module)

  • Command: adb shell dumpsys nfc | grep mScreenState=
  • Output:
    • mScreenState=OFF_LOCKED -> Screen OFF (and Locked)
    • mScreenState=ON_XXX -> Screen ON
      • mScreenState=ON_LOCKED -> Screen ON (and Locked)
      • mScreenState=ON_UNLOCKED -> Screen ON (and Unlocked)

method 4: use service call

  • Command: adb shell service call power 12
  • Output:
    • Result: Parcel(00000000 00000000 '........') -> 0 means Screen OFF
    • Result: Parcel(00000000 00000001 '........') -> 1 means Screen ON