allwright

API ReferenceTypeScriptMobile

Mobile

Android automation over adb — no Appium, no separate driver server. Reached through the mobile namespace, for both Android and iOS.

mobile.android.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.

mobile.android.connect(options?: MobileAndroidConnectOptions): Promise<MobileAndroidDevice>

Example

const device = await mobile.android.connect({ appId: "com.example.airticket" });

MobileAndroidDevice.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.

launch(options?: MobileAndroidLaunchOptions): Promise<MobileAndroidApp>

androidApp.click

MethodSince v0.0.45 – v0.0.52

Taps the matching element.

click(selector: string, options?: CommandOptions): Promise<void>

Example

await androidApp.click('Id=com.example.airticket:id/bottom_nav_account');

mobile app goto / navigate

MethodSince v0.1.19

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

goto(url: string, options?: CommandOptions): Promise<void>
navigate(url: string, options?: CommandOptions): Promise<void>

androidApp.fill

MethodSince v0.0.45 – v0.0.52

Sets a matching field's value.

fill(selector: string, value: string, options?: CommandOptions): Promise<void>

androidApp.focus / press

MethodSince v0.0.57 – v0.0.58

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

focus(selector: string, options?: CommandOptions): Promise<void>
press(selector: string, key: string, options?: PressOptions): Promise<void>

androidApp.count

MethodSince v0.0.57 – v0.0.58

Counts matching elements.

count(selector: string, options?: CommandOptions): Promise<number>

androidApp.textContent / innerText

MethodSince v0.0.57 – v0.0.58

Reads text from a matching element.

textContent(selector: string, options?: CommandOptions): Promise<string | null>
innerText(selector: string, options?: CommandOptions): Promise<string>

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 are available on NativeAppLocator; selected-option and selected-text reads remain web-only.

inputValue(selector: string, options?: CommandOptions): Promise<string>
isChecked(selector: string, options?: CommandOptions): Promise<boolean>
getAttribute(selector: string, name: string, options?: CommandOptions): Promise<string | null>
boundingBox(selector: string, options?: CommandOptions): Promise<BoundingBox | null>

androidApp.waitForSelector

MethodSince v0.0.57 – v0.0.58

Waits, retrying, for an element to appear.

waitForSelector(selector: string, options?: WaitForSelectorOptions): Promise<void>

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.

screenshot(options?: ScreenshotOptions): Promise<Uint8Array>

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.

accessibilitySnapshot(options?: AccessibilitySnapshotOptions): Promise<string>

androidApp.locator

MethodSince v0.0.45 – v0.0.52

Builds a chainable locator scoped to the app. Android, iOS, macOS, and Windows use the shared NativeApp/NativeAppLocator contract and expose getByRole, getByText, getByLabel, and getByTestId with native accessibility semantics and automatic retries.

locator(selector: string): NativeAppLocator

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.

mobile.ios.connect(options?: MobileIosConnectOptions): Promise<MobileIosDevice>

Example

const device = await mobile.ios.connect({ device: "iPhone 17 Pro" });

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 native app and locator contract.

launch(options?: MobileIosLaunchOptions): Promise<MobileIosApp>

Example

const app = await device.launch({ appPath: "https://allwright.dev/Flights-simulator.ipa" });
await app.getByRole("button", { name: "Login", exact: true }).click();