API ReferenceGoMobile
Mobile
Android automation over adb — no Appium, no separate driver server. Reached through the Mobile package variable; iOS has no runtime yet.
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) (*AndroidApp, error)Example
app, _ := device.Launch(ctx, allwright.MobileAndroidLaunchOptions{AppID: "com.example.airticket"})(*AndroidApp).Click
Taps the matching element.
func (p *AndroidApp) Click(ctx context.Context, selector string, options ...CommandOptions) (*ClickResult, error)Example
app.Click(ctx, "Id=com.example.airticket:id/bottom_nav_account")(*AndroidApp).Fill
Sets a matching field's value.
func (p *AndroidApp) Fill(ctx context.Context, selector string, value string, options ...CommandOptions) (*FillResult, error)(*AndroidApp).Focus / Press
Focuses a matching element, or sends it a key event.
func (p *AndroidApp) Focus(ctx context.Context, selector string, options ...CommandOptions) (*ElementResult, error)
func (p *AndroidApp) Press(ctx context.Context, selector string, key string, options ...PressOptions) (*PressResult, error)(*AndroidApp).Count
Counts matching elements.
func (p *AndroidApp) Count(ctx context.Context, selector string, options ...CommandOptions) (*CountResult, error)(*AndroidApp).TextContent / InnerText
Reads text from a matching element.
func (p *AndroidApp) TextContent(ctx context.Context, selector string, options ...CommandOptions) (*TextResult, error)(*AndroidApp).WaitForSelector
Waits, retrying, for an element to appear.
func (p *AndroidApp) WaitForSelector(ctx context.Context, selector string, options ...WaitForSelectorOptions) (*WaitForSelectorResult, error)(*AndroidApp).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 *AndroidApp) Screenshot(ctx context.Context, options ...ScreenshotOptions) (*ScreenshotResult, error)(*AndroidApp).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 *AndroidApp) AccessibilitySnapshot(ctx context.Context, options ...AccessibilitySnapshotOptions) (string, error)(*AndroidApp).Locator
Builds a chainable locator scoped to the app. Android has no GetByRole-style semantic builders — only raw CSS/XPath/UiAutomator (text=, resourceId=, className=, clickable=true) selectors.
func (p *AndroidApp) Locator(selector string) *AndroidLocator