跳转至

client.implements.remote_windows

remote_windows

类:

名称 描述
RemoteWindowsServer

XML-RPC server that exposes a WindowsImpl instance.

RemoteWindowsImpl

Client implementation that connects to a remote Windows machine via XML-RPC.

RemoteWindowsServer

XML-RPC server that exposes a WindowsImpl instance.

This class wraps a WindowsImpl instance and exposes its methods via XML-RPC.

方法:

名称 描述
__init__

Initialize the server with the given host and port.

start

Start the XML-RPC server.

start_in_thread

Start the XML-RPC server in a separate thread.

screenshot

Take a screenshot and return it as a base64-encoded string.

get_screen_size

Get the screen size.

detect_orientation

Detect the screen orientation.

click

Click at the given coordinates.

swipe

Swipe from (x1, y1) to (x2, y2).

get_scale_ratio

Get the scale ratio.

ping

Check if the server is alive.

__init__

__init__(windows_impl_config: WindowsImplConfig, host='localhost', port=8000)

Initialize the server with the given host and port.

start

start()

Start the XML-RPC server.

start_in_thread

start_in_thread()

Start the XML-RPC server in a separate thread.

screenshot

screenshot() -> str

Take a screenshot and return it as a base64-encoded string.

get_screen_size

get_screen_size() -> tuple[int, int]

Get the screen size.

detect_orientation

detect_orientation() -> str | None

Detect the screen orientation.

click

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

Click at the given coordinates.

swipe

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

Swipe from (x1, y1) to (x2, y2).

get_scale_ratio

get_scale_ratio() -> float

Get the scale ratio.

ping

ping() -> bool

Check if the server is alive.

RemoteWindowsImpl

Bases: Touchable, Screenshotable, Lifecycle, SimpleInputDriver

Client implementation that connects to a remote Windows machine via XML-RPC.

This class implements the same interfaces as WindowsImpl but forwards all method calls to a remote server.

方法:

名称 描述
__init__

Initialize the client with the given device, host, and port.

detect_orientation

Detect the screen orientation from the remote server.

screenshot

Take a screenshot from the remote server.

click

Click at the given coordinates on the remote server.

swipe

Swipe from (x1, y1) to (x2, y2) on the remote server.

属性:

名称 类型 描述
scale_ratio float

Get the scale ratio from the remote server.

screen_size tuple[int, int]

Get the screen size from the remote server.

scale_ratio cached property

scale_ratio: float

Get the scale ratio from the remote server.

screen_size property

screen_size: tuple[int, int]

Get the screen size from the remote server.

__init__

__init__(device: Device, host='localhost', port=8000)

Initialize the client with the given device, host, and port.

detect_orientation

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

Detect the screen orientation from the remote server.

screenshot

screenshot() -> MatLike

Take a screenshot from the remote server.

click

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

Click at the given coordinates on the remote server.

swipe

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

Swipe from (x1, y1) to (x2, y2) on the remote server.