API ReferenceRustMobile
Mobile
Android automation over adb — no Appium, no separate driver server. Reached through the allwright::mobile::android and allwright::mobile::ios modules. 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<NativeApp>NativeApp::click
Taps the matching element.
pub async fn click(&self, selector: &str, options: CommandOptions) -> Result<()>Example
app.click(selector, CommandOptions::default()).await?;NativeApp::fill
Sets a matching field's value.
pub async fn fill(&self, selector: &str, value: &str, options: CommandOptions) -> Result<()>NativeApp::focus / press
Focuses a matching element, or sends it a key event.
pub async fn focus(&self, selector: &str, options: CommandOptions) -> Result<()>
pub async fn press(&self, selector: &str, key: &str, options: PressOptions) -> Result<()>NativeApp::count
Counts matching elements.
pub async fn count(&self, selector: &str, options: CommandOptions) -> Result<u32>NativeApp::text_content / inner_text
Reads text from a matching element.
pub async fn text_content(&self, selector: &str, options: CommandOptions) -> Result<Option<String>>
pub async fn inner_text(&self, selector: &str, options: CommandOptions) -> Result<String>NativeApp 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.
pub async fn input_value(&self, selector: &str, options: CommandOptions) -> Result<String>
pub async fn is_checked(&self, selector: &str, options: CommandOptions) -> Result<bool>
pub async fn get_attribute(&self, selector: &str, name: &str, options: CommandOptions) -> Result<Option<String>>
pub async fn bounding_box(&self, selector: &str, options: CommandOptions) -> Result<Option<BoundingBox>>NativeApp::wait_for_selector
Waits, retrying, for an element to appear.
pub async fn wait_for_selector(&self, selector: &str, options: WaitForSelectorOptions) -> Result<()>NativeApp::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<Vec<u8>>NativeApp::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>NativeApp::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.
pub fn locator(&self, selector: impl Into<String>) -> 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.
pub async fn connect(options: MobileIosConnectOptions) -> Result<IosDevice>Example
let device = mobile::ios::connect(MobileIosConnectOptions { device: Some("iPhone 17 Pro".into()), ..Default::default() }).await?;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.
pub async fn launch(&self, options: MobileIosLaunchOptions) -> Result<IosApp>Example
let app = device.launch(MobileIosLaunchOptions { app_path: Some("https://allwright.dev/Flights-simulator.ipa".into()), ..Default::default() }).await?;