Skip to content

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.

ParameterTypeDescription
xnumberX coordinate in device pixels.
ynumberY 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.

ParameterTypeDescription
xnumberX coordinate.
ynumberY coordinate.
ms?numberHold 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.

ParameterTypeDescription
fromPointStart point { x, y }.
toPointEnd point { x, y }.
ms?numberSwipe 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 });