Get screen status using ADB

I need to find out in my script if the device screen is off. Is there a simple command to get this kind of information through ADB?

+6
android adb
source share
2 answers

dumpsys power | grep mScreenOn

+13
source share

In 5.0, it looks like you should run grep dumpsys power output for

 Display Power: state=OFF 

or

 Display Power: state=ON 
+3
source share

All Articles