Skip to main content

AndroidInput


方法 (Methods)

drag

Added in: v1.9 androidInput.drag

Performs a drag between from and to points.

使用方式

await androidInput.drag(from, to, steps);

參數

傳回值


press

Added in: v1.9 androidInput.press

Presses the key.

使用方式

await androidInput.press(key);

參數

  • key [AndroidKey]#

    Key to press.

傳回值


swipe

Added in: v1.9 androidInput.swipe

Swipes following the path defined by segments.

使用方式

await androidInput.swipe(from, segments, steps);

參數

  • from Object#

    The point to start swiping from.

  • segments Array<Object>#

    Points following the from point in the swipe gesture.

  • steps number#

    The number of steps for each segment. Each step takes 5 milliseconds to complete, so 100 steps means half a second per each segment.

傳回值


tap

Added in: v1.9 androidInput.tap

Taps at the specified point.

使用方式

await androidInput.tap(point);

參數

傳回值


type

Added in: v1.9 androidInput.type

Types text into currently focused widget.

使用方式

await androidInput.type(text);

參數

傳回值