Skip to main content
Phone-only operations of an Android [Machine]. Obtain via [Machine.asAndroid]. Cross-platform operations (apps, mouse, clipboard, …) live on [Machine] itself; this escape hatch is only for controls that have no desktop counterpart (status bar, orientation, package enablement, touch gestures with explicit timing).

Constructor

Returns

AndroidExtras

Properties

string
required
The adb serial (host:port) this device is connected through.

Methods

collapseShade()

Collapse the notification shade / quick-settings panel.

landscape()

Lock the screen to landscape orientation. The freeze overrides auto-rotate until the orientation is set again.

notifications()

Open the notification shade.

portrait()

Lock the screen to portrait orientation. The freeze overrides auto-rotate until the orientation is set again.

quickSettings()

Open the quick-settings panel.

setPackageEnabled()

Enable or disable an installed package. Disabling uses the unprivileged, per-user reversible form; enabled: true reverses it.

Parameters

string
required
boolean
required

swipe()

Swipe (touch-drag) from (fromX, fromY) to (toX, toY), holding the finger down for durationMs while it travels. Coordinates are absolute device pixels in the current rotation’s space. The whole gesture ships to the device as one atomic pointer sequence, so nothing is held open across calls. The duration decides what the gesture means to the app: brief (well under ~200ms) reads as a fling that keeps scrolling with momentum, longer as a deliberate drag that stops where the finger stops. For a plain drag the cross-platform mouse lowering ([Machine.moveMouse] + [Machine.mouseButton] press/release) is equivalent and portable — it synthesizes this same gesture at a fixed 200ms. Reach for this method only when the timing matters.

Parameters

number
required
number
required
number
required
number
required
number
required