android uiautomator的python包装的增强。提供图像比较方法
uiautomatorplug的Python项目详细描述
参考:
android uiautomator的python包装器:
https://pypi.python.org/pypi/uiautomator/
依赖性:
1:sudo apt get install python opencv
2:sudo apt get install python numpy
3:目标Android设备:sdk_version>;=16
用法:
>>> from uiautomatorplug.android import device as d
>>> d.info
>>> d.orientation
>>> d.orientation = 'l'
>>> d.wakeup()
>>> d.start_activity('--activity-clear-task', action='android.intent.action.DIAL', data='tel:xxxx', flags=0x04000000)
>>> d.start_activity('--activity-clear-task', component='com.android.settings/.Settings') >>> d.find('phone_launch_success.png')
>>> d.click(100, 200)
>>> d.click('abspath/DPAD_NUMBER_1.png')
>>> d.click('abspath/DPAD_NUMBER_1.png', rotation=90)
>>> d.exists(text='string_value_of_screen_layout_component_text_attribute')
>>> d.expect('abspath/phone_launch_success.png')
>>> d(text='Settings').click()