i want to know how to get the status of android phone screen whether its locked or unlocked using monkeyrunner . please help .
Thanks in advance
Using AndroidViewClient (>= 4.7.0) (which uses python instead of monkeyrunner`) you can do
from com.dtmilano.android.viewclient import ViewClient
device, serialno = ViewClient.connectToDeviceOrExit()
if device.isLocked():
device.wake()
device.unlock()