allwright

API ReferenceJavaMobile

Mobile

Android automation over adb — no Appium, no separate driver server. Reached through Allwright.mobile().android(); iOS has no runtime yet.

AndroidSurface.connect

MethodSince v0.0.45 – v0.0.52

Connects to a device or emulator over adb (by serial, or the first one available) and returns a device handle.

public AndroidDevice connect()
public AndroidDevice connect(MobileAndroidConnectOptions options)

Example

AndroidDevice device = Allwright.mobile().android().connect(new MobileAndroidConnectOptions("emulator-5554", null, false, 30_000));

AndroidDevice.launch

MethodSince v0.0.45 – v0.0.52

Installs (from a local APK path or a URL) and launches an app, resolving the package from appId or the APK's own metadata.

public synchronized AndroidApp launch()
public synchronized AndroidApp launch(MobileAndroidLaunchOptions options)

AndroidApp.click

MethodSince v0.0.45 – v0.0.52

Taps the matching element.

public synchronized ClickResult click(String selector)
public synchronized ClickResult click(String selector, CommandOptions options)

AndroidApp.fill

MethodSince v0.0.45 – v0.0.52

Sets a matching field's value.

public synchronized FillResult fill(String selector, String value)
public synchronized FillResult fill(String selector, String value, CommandOptions options)

Example

app.fill("xpath=//*[@text=\"Email\"]", "user@example.com");

AndroidApp.focus / press

MethodSince v0.0.57 – v0.0.58

Focuses a matching element, or sends it a key event.

public synchronized ElementResult focus(String selector)
public synchronized PressResult press(String selector, String key)

AndroidApp.count

MethodSince v0.0.57 – v0.0.58

Counts matching elements.

public synchronized CountResult count(String selector)

AndroidApp.textContent / innerText

MethodSince v0.0.57 – v0.0.58

Reads text from a matching element.

public synchronized TextResult textContent(String selector)
public synchronized TextResult innerText(String selector)

AndroidApp.waitForSelector

MethodSince v0.0.57 – v0.0.58

Waits, retrying, for an element to appear.

public synchronized WaitForSelectorResult waitForSelector(String selector)

AndroidApp.screenshot

MethodSince v0.0.57 – v0.0.58

Captures the app UI as a PNG; a full-page capture stitches several scrolled captures into one image.

public synchronized ScreenshotResult screenshot()
public synchronized ScreenshotResult screenshot(ScreenshotOptions options)

AndroidApp.accessibilitySnapshot

MethodSince v0.1.4

Captures a structured accessibility snapshot of the app UI — the same versioned JSON/YAML document shape as the web surface's snapshot.

public synchronized String accessibilitySnapshot()
public synchronized String accessibilitySnapshot(AccessibilitySnapshotOptions options)

AndroidApp.locator

MethodSince v0.0.45 – v0.0.52

Builds a chainable locator scoped to the app. Android has no getByRole-style semantic builders — only raw CSS/XPath/UiAutomator selectors.

public AndroidLocator locator(String selector)