API ReferenceGoMobile
Mobile
Android automation over adb — no Appium, no separate driver server. Reached through the Mobile package variable, 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.
func (AndroidSurface) Connect(ctx context.Context, options MobileAndroidConnectOptions) (*AndroidDevice, error)Example
device, _ := allwright.Mobile.Android.Connect(ctx, allwright.MobileAndroidConnectOptions{Device: "emulator-5554"})(*AndroidDevice).Launch
Installs (from a local APK path or a URL) and launches an app, resolving the package from AppID or the APK's own metadata.
func (d *AndroidDevice) Launch(ctx context.Context, options MobileAndroidLaunchOptions) (*NativeApp, error)Example
app, _ := device.Launch(ctx, allwright.MobileAndroidLaunchOptions{AppID: "com.example.airticket"})(*NativeApp).Click
Taps the matching element.
func (p *NativeApp) Click(ctx context.Context, selector string, options ...CommandOptions) errorExample
app.Click(ctx, "Id=com.example.airticket:id/bottom_nav_account")(*NativeApp).Fill
Sets a matching field's value.
func (p *NativeApp) Fill(ctx context.Context, selector string, value string, options ...CommandOptions) error(*NativeApp).Focus / Press
Focuses a matching element, or sends it a key event.
func (p *NativeApp) Focus(ctx context.Context, selector string, options ...CommandOptions) error
func (p *NativeApp) Press(ctx context.Context, selector string, key string, options ...PressOptions) error(*NativeApp).Count
Counts matching elements.
func (p *NativeApp) Count(ctx context.Context, selector string, options ...CommandOptions) (int, error)(*NativeApp).TextContent / InnerText
Reads text from a matching element.
func (p *NativeApp) TextContent(ctx context.Context, selector string, options ...CommandOptions) (string, error)
func (p *NativeApp) InnerText(ctx context.Context, selector string, options ...CommandOptions) (string, error)(*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.
func (p *NativeApp) InputValue(ctx context.Context, selector string, options ...CommandOptions) (string, error)
func (p *NativeApp) IsChecked(ctx context.Context, selector string, options ...CommandOptions) (bool, error)
func (p *NativeApp) GetAttribute(ctx context.Context, selector, name string, options ...CommandOptions) (*string, error)
func (p *NativeApp) BoundingBox(ctx context.Context, selector string, options ...CommandOptions) (*BoundingBox, error)(*NativeApp).WaitForSelector
Waits, retrying, for an element to appear.
func (p *NativeApp) WaitForSelector(ctx context.Context, selector string, options ...WaitForSelectorOptions) error(*NativeApp).Screenshot
Captures the app UI as a PNG; a full-page capture stitches several scrolled captures into one image instead of cropping at the visible screen.
func (p *NativeApp) Screenshot(ctx context.Context, options ...ScreenshotOptions) ([]byte, error)(*NativeApp).AccessibilitySnapshot
Captures a structured accessibility snapshot of the app UI — the same versioned JSON/YAML document shape as the web surface's snapshot.
func (t *NativeApp) AccessibilitySnapshot(ctx context.Context, options ...AccessibilitySnapshotOptions) (string, error)(*NativeApp).Locator
Builds a chainable locator scoped to the app. Native apps and locators expose GetByRole, GetByText, GetByLabel, and GetByTestId with native accessibility semantics and automatic retries.
func (p *NativeApp) Locator(selector 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.
func (IOSSurface) Connect(ctx context.Context, options MobileIOSConnectOptions) (*IOSDevice, error)Example
device, _ := allwright.Mobile.IOS.Connect(ctx, allwright.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.
func (d *IOSDevice) Launch(ctx context.Context, options MobileIOSLaunchOptions) (*IOSApp, error)Example
app, _ := device.Launch(ctx, allwright.MobileIOSLaunchOptions{AppPath: "https://allwright.dev/Flights-simulator.ipa"})