allwright

API ReferenceJavaMobile

Mobile

Android automation over adb — no Appium, no separate driver server. Reached through Allwright.mobile().android() and Allwright.mobile().ios().

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 void click(String selector)
public void click(String selector, CommandOptions options)

AndroidApp.goTo / navigate

MethodSince v0.1.19

Opens a universal link or custom URL scheme in the connected Android or iOS app.

public void goTo(String url)
public void navigate(String url)

AndroidApp.fill

MethodSince v0.0.45 – v0.0.52

Sets a matching field's value.

public void fill(String selector, String value)
public void 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 void focus(String selector)
public void press(String selector, String key)

AndroidApp.count

MethodSince v0.0.57 – v0.0.58

Counts matching elements.

public int count(String selector)

AndroidApp.textContent / innerText

MethodSince v0.0.57 – v0.0.58

Reads text from a matching element.

public String textContent(String selector)
public String innerText(String selector)

NativeApp state reads

MethodSince v0.1.24

Reads native input values, checked/selected state, known accessibility attributes, and on-screen bounds on Android, iOS, macOS, and Windows. The same methods and CommandOptions overloads are available on NativeLocator; selected-option and selected-text reads remain web-only.

public String inputValue(String selector)
public boolean isChecked(String selector)
public String getAttribute(String selector, String name)
public BoundingBox boundingBox(String selector)

AndroidApp.waitForSelector

MethodSince v0.0.57 – v0.0.58

Waits, retrying, for an element to appear.

public void 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 byte[] screenshot()
public byte[] 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. Native apps and locators expose getByRole, getByText, getByLabel, and getByTestId with native accessibility semantics and automatic retries.

public NativeLocator locator(String selector)

Allwright.mobile().ios().connect

MethodSince v0.1.18

Connects to an iOS Simulator or a registered physical device (by name or UDID, or the first one available) and returns a device handle. The runtime is installed and started automatically.

public IosDevice connect()
public IosDevice connect(MobileIosConnectOptions options)

Example

IosDevice device = Allwright.mobile().ios().connect(new MobileIosConnectOptions("iPhone 17 Pro", null, false, null));

iOS device launch

MethodSince v0.1.18

Downloads or unpacks an app (local .app, .zip/.ipa, or URL), installs it on the connected Simulator or device, and launches it. app_id is optional when an app path is given. The returned app implements the shared NativeApp/NativeLocator contract.

public synchronized NativeApp launch()
public synchronized NativeApp launch(MobileIosLaunchOptions options)

Example

var app = device.launch(new MobileIosLaunchOptions("https://allwright.dev/Flights-simulator.ipa", null, false, null));