跳转至

client.implements.uiautomator2

uiautomator2

类:

名称 描述
UiAutomator2Impl

UiAutomator2Impl

Bases: Screenshotable, Commandable, Touchable, SimpleInputDriver

方法:

名称 描述
screenshot

截图

detect_orientation

检测设备方向

launch_app

启动应用

current_package

获取当前应用包名

click

点击屏幕

swipe

滑动屏幕

screenshot

screenshot() -> MatLike

截图

detect_orientation

detect_orientation() -> Literal['portrait', 'landscape'] | None

检测设备方向

launch_app

launch_app(package_name: str) -> None

启动应用

current_package

current_package() -> str | None

获取当前应用包名

click

click(x: int, y: int) -> None

点击屏幕

swipe

swipe(x1: int, y1: int, x2: int, y2: int, duration: float | None = None) -> None

滑动屏幕