allwright

API ReferenceRustMobile

Mobile

Android automation over adb — no Appium, no separate driver server. Reached through the allwright::mobile::android module; iOS has no runtime yet. Android methods take options directly, without a *_with_options split.

mobile::android::connect

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

pub async fn connect(options: MobileAndroidConnectOptions) -> Result<AndroidDevice>

Example

let device = mobile::android::connect(MobileAndroidConnectOptions { device: Some("emulator-5554".into()), ..Default::default() }).await?;

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.

pub async fn launch(&self, options: MobileAndroidLaunchOptions) -> Result<AndroidApp>

AndroidApp::click

MethodSince v0.0.45 – v0.0.52

Taps the matching element.

pub async fn click(&self, selector: &str, options: CommandOptions) -> Result<ClickResult>

Example

app.click(selector, CommandOptions::default()).await?;

AndroidApp::fill

MethodSince v0.0.45 – v0.0.52

Sets a matching field's value.

pub async fn fill(&self, selector: &str, value: &str, options: CommandOptions) -> Result<FillResult>

AndroidApp::focus / press

MethodSince v0.0.57 – v0.0.58

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

pub async fn focus(&self, selector: &str, options: CommandOptions) -> Result<ElementResult>
pub async fn press(&self, selector: &str, key: &str, options: PressOptions) -> Result<PressResult>

AndroidApp::count

MethodSince v0.0.57 – v0.0.58

Counts matching elements.

pub async fn count(&self, selector: &str, options: CommandOptions) -> Result<CountResult>

AndroidApp::text_content / inner_text

MethodSince v0.0.57 – v0.0.58

Reads text from a matching element.

pub async fn text_content(&self, selector: &str, options: CommandOptions) -> Result<TextResult>

AndroidApp::wait_for_selector

MethodSince v0.0.57 – v0.0.58

Waits, retrying, for an element to appear.

pub async fn wait_for_selector(&self, selector: &str, options: WaitForSelectorOptions) -> Result<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.

pub async fn screenshot_with_options(&self, options: ScreenshotOptions) -> Result<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.

pub async fn accessibility_snapshot_with_options(&self, options: AccessibilitySnapshotOptions) -> Result<String>

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/id=/xpath=/uia= selectors.

pub fn locator(&self, selector: impl Into<String>) -> AndroidLocator