Skip to content

Commit 6940d6f

Browse files
committed
AdbClient.unlock() screen method added
- Version 4.7.0
1 parent 5b36785 commit 6940d6f

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

AndroidViewClient/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup, find_packages
44

55
setup(name='androidviewclient',
6-
version='4.6.1',
6+
version='4.7.0',
77
description='''AndroidViewClient is a 100% pure python tool that
88
simplifies test script creation providing higher level operations and the ability of
99
obtaining the tree of Views present at any given moment on the device or emulator screen.

AndroidViewClient/src/com/dtmilano/android/adb/adbclient.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@author: Diego Torres Milano
1818
'''
1919

20-
__version__ = '4.6.1'
20+
__version__ = '4.7.0'
2121

2222
import sys
2323
import warnings
@@ -380,7 +380,7 @@ def type(self, text):
380380
self.shell(u'input text "%s"' % text)
381381

382382
def wake(self):
383-
self.shell('input keyevent 26')
383+
self.shell('input keyevent POWER')
384384

385385
def isLocked(self):
386386
'''
@@ -395,6 +395,13 @@ def isLocked(self):
395395
return (m.group(1) == 'true')
396396
raise RuntimeError("Couldn't determine screen lock state")
397397

398+
def unlock(self):
399+
'''
400+
Unlocks the screen of the device.
401+
'''
402+
403+
self.shell('input keyevent MENU')
404+
self.shell('input keyevent BACK')
398405

399406
@staticmethod
400407
def percentSame(image1, image2):

0 commit comments

Comments
 (0)