API ReferencePythonMobile
Mobile
Android automation over adb — no Appium, no separate driver server. Reached through the mobile singleton, for both Android and iOS.
mobile.android.connect
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) -> AndroidDeviceExample
from allwright import mobile
device = mobile.android.connect(MobileAndroidConnectOptions(device="emulator-5554"))AndroidDevice.launch
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) -> NativeAppExample
app = device.launch(MobileAndroidLaunchOptions(app_id="com.example.airticket"))NativeApp.click
Taps the matching element.
def click(self, selector: str, options: CommandOptions | None = None) -> NoneExample
app.click("Id=com.example.airticket:id/bottom_nav_account")NativeApp.fill
Sets a matching field's value.
def fill(self, selector: str, value: str, options: CommandOptions | None = None) -> NoneNativeApp.focus / press
Focuses a matching element, or sends it a key event.
def focus(self, selector: str, options: CommandOptions | None = None) -> None
def press(self, selector: str, key: str, options: PressOptions | None = None) -> NoneNativeApp.count
Counts matching elements.
def count(self, selector: str, options: CommandOptions | None = None) -> intNativeApp.text_content / inner_text
Reads text from a matching element.
def text_content(self, selector: str, options: CommandOptions | None = None) -> str | None
def inner_text(self, selector: str, options: CommandOptions | None = None) -> strNativeApp state reads
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 NativeLocator; selected-option and selected-text reads remain web-only.
def input_value(self, selector: str, options: CommandOptions | None = None) -> str
def is_checked(self, selector: str, options: CommandOptions | None = None) -> bool
def get_attribute(self, selector: str, name: str, options: CommandOptions | None = None) -> str | None
def bounding_box(self, selector: str, options: CommandOptions | None = None) -> BoundingBox | NoneNativeApp.wait_for_selector
Waits, retrying, for an element to appear.
def wait_for_selector(self, selector: str, options: WaitForSelectorOptions | None = None) -> NoneNativeApp.screenshot
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) -> bytesNativeApp.accessibility_snapshot
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) -> strNativeApp.locator
Builds a chainable locator scoped to the app. Native apps and locators expose get_by_role, get_by_text, get_by_label, and get_by_test_id with native accessibility semantics and automatic retries.
def locator(self, selector: str) -> NativeLocatormobile.ios.connect
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.
def connect(self, options: MobileIosConnectOptions | None = None) -> IosDeviceExample
device = mobile.ios.connect(MobileIosConnectOptions(device="iPhone 17 Pro"))iOS device launch
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.
def launch(self, options: MobileIosLaunchOptions | None = None) -> IosAppExample
app = device.launch(MobileIosLaunchOptions(app_path="https://allwright.dev/Flights-simulator.ipa"))