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
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
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
Taps the matching element.
public synchronized ClickResult click(String selector)
public synchronized ClickResult click(String selector, CommandOptions options)AndroidApp.fill
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
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
Counts matching elements.
public synchronized CountResult count(String selector)AndroidApp.textContent / innerText
Reads text from a matching element.
public synchronized TextResult textContent(String selector)
public synchronized TextResult innerText(String selector)AndroidApp.waitForSelector
Waits, retrying, for an element to appear.
public synchronized WaitForSelectorResult waitForSelector(String selector)AndroidApp.screenshot
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
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
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)