CheckOps home

Tools directory

U

CheckOps

UI Automator

UI Automator is Google's Android UI testing framework for cross-app and system UI automation; version 2.4 introduced a modern Kotlin API with a uiAutomator test scope, onElement predicates and built-in waiting.

Visit website

Latest public signals

Last updated: 16 November 2026 (weekly freshness scan: page extended).

Visit Website

Introduction

UI Automator is part of Android’s testing toolkit for black-box UI tests that interact with any visible element on the device, including system UI, settings and other apps. That makes it the right tool for flows that leave your app, such as permission dialogs, notifications, share sheets or launching from the home screen, which Espresso cannot reach.

Google’s documentation now covers a modern approach introduced with UI Automator 2.4, which it says makes tests more concise, readable and robust, and recommends for new development while the API is still evolving (the docs reference androidx.test.uiautomator:uiautomator:2.4.0-alpha05). Key features include a dedicated uiAutomator { ... } test scope, onElement, onElements and onElementOrNull methods that find elements with clear predicates on properties such as text, resource ID, focus or content description, built-in waiting with timeouts, and watchers such as watchFor(PermissionDialog) { clickAllow() } to handle system dialogs. The classic UiDevice and By selector APIs remain available, and Kaspresso wraps UI Automator in its Kautomator DSL.

Features

  1. Cross-app automation: System UI, settings and other apps.
  2. Modern Kotlin API: uiAutomator { onElement { ... }.click() }.
  3. Built-in waiting: Timeouts on element lookups.
  4. Dialog watchers: Handle permission prompts automatically.

Pros

  1. Free: Part of AndroidX Test.
  2. Official: Maintained by Google.

Cons

  1. Slower than Espresso: Black-box, cross-process interactions.
  2. Evolving API: The 2.4 API is still marked under development.
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.4.0-alpha05")
@Test
fun grantsLocationAndShowsStores() = uiAutomator {
    startApp("com.example.shop")
    onElement { textAsString() == "Find stores" }.click()
    watchFor(PermissionDialog) { clickAllow() }
    onElement { viewIdResourceName == "store_list" }
}

Resources:

Pricing

Free and open source as part of AndroidX Test (Apache-2.0).

  1. Android teams testing flows across apps or system UI.
  2. Teams handling permission dialogs and notifications in UI tests.

Conclusion

UI Automator is essential for Android tests that go beyond a single app, and its new Kotlin API makes those tests far more readable.

UI Automator is part of AndroidX Test and runs as instrumented tests through AndroidJUnitRunner on devices or emulators running Android 4.3 (API level 18) or later. Because it can drive any visible UI, including system dialogs, settings and other apps, it complements Espresso, which works inside your own app’s process. A common pattern is to write most in-app checks with Espresso and keep UI Automator for cross-app steps such as permission dialogs, notifications and the launcher.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with UI Automator side by side.