allwright

API ReferencePythonMobile

Mobile

Android automation over adb — no Appium, no separate driver server. Reached through the mobile singleton; iOS has no runtime yet.

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.

def connect(self, options: MobileAndroidConnectOptions | None = None) -> AndroidDevice

Example

from allwright import mobile
device = mobile.android.connect(MobileAndroidConnectOptions(device="emulator-5554"))

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 app_id or the APK's own metadata.

def launch(self, options: MobileAndroidLaunchOptions | None = None) -> AndroidApp

Example

app = device.launch(MobileAndroidLaunchOptions(app_id="com.example.airticket"))

AndroidApp.click

MethodSince v0.0.45 – v0.0.52

Taps the matching element.

def click(self, selector: str, options: CommandOptions | None = None) -> ClickResult

Example

app.click("Id=com.example.airticket:id/bottom_nav_account")

AndroidApp.fill

MethodSince v0.0.45 – v0.0.52

Sets a matching field's value.

def fill(self, selector: str, value: str, options: CommandOptions | None = None) -> FillResult

AndroidApp.focus / press

MethodSince v0.0.57 – v0.0.58

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

def focus(self, selector: str, options: CommandOptions | None = None) -> ElementResult
def press(self, selector: str, key: str, options: PressOptions | None = None) -> PressResult

AndroidApp.count

MethodSince v0.0.57 – v0.0.58

Counts matching elements.

def count(self, selector: str, options: CommandOptions | None = None) -> CountResult

AndroidApp.text_content / inner_text

MethodSince v0.0.57 – v0.0.58

Reads text from a matching element.

def text_content(self, selector: str, options: CommandOptions | None = None) -> TextResult

AndroidApp.wait_for_selector

MethodSince v0.0.57 – v0.0.58

Waits, retrying, for an element to appear.

def wait_for_selector(self, selector: str, options: WaitForSelectorOptions | None = None) -> WaitForSelectorResult

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.

def screenshot(self, options: ScreenshotOptions | None = None) -> ScreenshotResult

AndroidApp.accessibility_snapshot

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.

def accessibility_snapshot(self, options: AccessibilitySnapshotOptions | None = None) -> str

AndroidApp.locator

MethodSince v0.0.45 – v0.0.52

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

def locator(self, selector: str) -> AndroidLocator