0

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

user
  • 65
  • 1
  • 11

1 Answers1

0

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()
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134