agent.actions.touch
Touch input on the device screen. Coordinates are in device pixels.
tap
Signature
tap(x: number, y: number): Promise<void>Taps the screen at the given device-pixel coordinates.
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate in device pixels. |
y | number | Y coordinate in device pixels. |
Returns Promise<void> — Resolves once the tap is dispatched.
Tap a button
await agent.actions.tap(540, 1200);hold
Signature
hold(x: number, y: number, ms?: number): Promise<void>Long-presses at the coordinates for the given duration.
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate. |
y | number | Y coordinate. |
ms? | number | Hold duration. (default: 600) |
Returns Promise<void> — Resolves once released.
swipe
Signature
swipe(from: Point, to: Point, ms?: number): Promise<void>Swipes between two points over the given duration.
| Parameter | Type | Description |
|---|---|---|
from | Point | Start point { x, y }. |
to | Point | End point { x, y }. |
ms? | number | Swipe duration. (default: 400) |
Returns Promise<void> — Resolves once the swipe completes.
Scroll up
await agent.actions.swipe({ x: 540, y: 1800 }, { x: 540, y: 600 });