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?
dumpsys power | grep mScreenOn
In 5.0, it looks like you should run grep dumpsys power output for
dumpsys power
Display Power: state=OFF
or
Display Power: state=ON