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
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
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
Taps the matching element.
pub async fn click(&self, selector: &str, options: CommandOptions) -> Result<ClickResult>Example
app.click(selector, CommandOptions::default()).await?;AndroidApp::fill
Sets a matching field's value.
pub async fn fill(&self, selector: &str, value: &str, options: CommandOptions) -> Result<FillResult>AndroidApp::focus / press
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
Counts matching elements.
pub async fn count(&self, selector: &str, options: CommandOptions) -> Result<CountResult>AndroidApp::text_content / inner_text
Reads text from a matching element.
pub async fn text_content(&self, selector: &str, options: CommandOptions) -> Result<TextResult>AndroidApp::wait_for_selector
Waits, retrying, for an element to appear.
pub async fn wait_for_selector(&self, selector: &str, options: WaitForSelectorOptions) -> Result<WaitForSelectorResult>AndroidApp::screenshot
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
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
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