Skip to main content
Android logo

UI Automator Product Review

CategoryMobile App Testing FrameworkFirst Released2012Official SiteDeploymentSelf-hosted
Licensing Model
Open Source
  • Apache 2.0 license
  • Part of AndroidX Test (Jetpack)
  • Free to use forever
  • Distributed via Google Maven
  • Maintained by the Android team
Free Trial
Free & Open Source
  • No licensing costs
  • No paid tier or subscription
  • Consumed as a Gradle dependency
  • Pay only for device or cloud infrastructure
Maintainer
Google (Android)
  • Original uiautomator released around 2012
  • UI Automator 2.0 around 2015
  • Part of AndroidX Test
  • Mountain View, California, USA
Ratings
  • G2N/A
  • GartnerN/A
  • CapterraN/A

Overview

UI Automator is Google's official black-box UI testing framework for Android. It provides APIs that let test code interact with user apps and system apps from outside the app's own process, so tests can drive the entire device UI rather than a single application. It is part of AndroidX Test, distributed as the androidx.test.uiautomator artifact. The original uiautomator tooling appeared around 2012, UI Automator 2.0 arrived around 2015, and the framework now lives under the AndroidX namespace.

The defining capability of UI Automator is cross-app and system-level testing. A single test can launch an app, press Home or Back, pull down the notification shade, open Quick Settings, navigate into the device Settings app, handle runtime permission dialogs, and switch between multiple apps. This is precisely the class of interaction that Espresso cannot perform, because Espresso is confined to the application under test's own process.

The target audience is Android QA engineers and developers who need to validate flows that span app boundaries or touch the Android system UI, such as notification handling, deep links that bounce through other apps, permission dialogs, sharing intents, and settings toggles. Because it is black-box, testers do not need the app's source code, and elements are located through the Android accessibility layer.

The core value is testing interactions across app boundaries and system UI that Espresso cannot reach, without requiring app source, using accessibility-based element discovery through By and UiObject2 in the modern API and UiSelector in the legacy API. A key differentiator is composability, since UI Automator and Espresso can be combined in the same test, with Espresso handling precise in-app assertions and UI Automator handling the cross-app and system steps. Notably, Appium's UiAutomator2 driver, the most widely used Appium Android driver, is built on top of Google's UI Automator.

The current stable release is 2.3.0, published in February 2024, which added multi-display support, new selectors, a public Condition interface, and gesture reliability fixes. A larger 2.4.0 line introduces a new Kotlin-friendly DSL with predicate-based finders, built-in waiting, and a mechanism to auto-dismiss unexpected dialogs. As of mid-2026, the 2.4.0 line remains in beta.

Key Featuresโ€‹

UiDeviceโ€‹

UiDevice provides device-level interactions such as pressing Home, Back, and Menu, opening the notification shade and Quick Settings, changing rotation, and taking screenshots. It also exposes device dimensions and shell command execution.

UiObject2 and By selectorsโ€‹

UiObject2 with By and BySelector is the modern element-finding API. By builds selectors by text, resource id, content description, class, package, and relationships, and UiObject2 is a live handle to a matched node.

UiSelector and UiObjectโ€‹

UiSelector and UiObject form the legacy API, which is still supported for querying and acting on elements. Newer projects favor the By and UiObject2 API.

Cross-app testingโ€‹

UI Automator can drive any installed app plus system apps in a single test session. This enables end-to-end flows that leave the app under test.

System UI interactionโ€‹

Tests can interact with notifications, the Settings app, Quick Settings, and runtime permission dialogs. This reaches parts of Android that in-app frameworks cannot.

Scrollingโ€‹

UiScrollable scrolls through scrollable containers to find off-screen elements, and scrollUntil scrolls until a condition is met. This handles long lists and feeds.

Waiting and synchronizationโ€‹

The wait method with Until conditions synchronizes tests with UI state, and a public Condition interface supports custom waits. The 2.4.0 DSL adds helpers such as waitForStable.

Screenshotsโ€‹

UiDevice.takeScreenshot captures the device screen, and the 2.4.0 DSL adds per-element and per-window screenshots. This provides visual evidence for debugging.

Gesture supportโ€‹

UI Automator supports click, long-click, swipe, drag, and pinch gestures, including multi-touch. Gesture emulation reliability improved in 2.3.0.

Device state controlโ€‹

Tests can set and freeze rotation and control screen state. This validates behavior across orientation and power states.

Multi-display supportโ€‹

UI Automator can operate on objects across multiple displays, with window-based APIs added in the 2.4.0 line. This supports modern multi-window scenarios.

AndroidJUnitRunner integrationโ€‹

UI Automator runs as JUnit4 instrumented tests through the AndroidJUnitRunner. This fits the standard Android test toolchain.

Accessibility-based identificationโ€‹

Elements are located through the accessibility node tree, so no app source code is required. This makes black-box testing possible against release builds.

Best Selling Pointsโ€‹

Cross-app and system testingโ€‹

UI Automator tests interactions across app boundaries and system UI that Espresso cannot do. This covers notifications, settings, permissions, and multi-app flows.

True black-box testingโ€‹

UI Automator works without app source code and can test release and minified builds. This suits black-box and end-to-end scenarios.

Complements Espressoโ€‹

UI Automator composes with Espresso in the same test, with Espresso for precise in-app assertions and UI Automator for system steps. The two are complementary rather than competing.

Device-level controlโ€‹

UiDevice provides Home and Back, notification shade, rotation, and screenshots. This gives tests control over the whole device.

Accessibility-based resilienceโ€‹

Elements are located through the accessibility layer, which is more stable than coordinates. This improves test resilience.

Official Google supportโ€‹

UI Automator is free, Apache 2.0, and part of the standard Android testing stack. It benefits from long-term Google maintenance.

Supported Integrationsโ€‹

UI Automator tests are standard Android instrumentation tests, so they integrate with the Android build toolchain, CI/CD, device clouds, and reporting tools, and they compose with Espresso.

Test Runners & Frameworks

  • JUnit4
  • AndroidJUnitRunner
  • AndroidX Test
  • Espresso (composition)

Build Tools

  • Gradle
  • Android Gradle Plugin
  • Google Maven

CI/CD Platforms

  • GitHub Actions
  • Jenkins
  • GitLab CI/CD
  • CircleCI
  • Bitrise

Device Clouds

  • Firebase Test Lab
  • BrowserStack
  • Sauce Labs
  • AWS Device Farm

Reporting

  • JUnit XML
  • Gradle HTML reports
  • Allure
  • Firebase Test Lab dashboards

Built On UI Automator

  • Appium UiAutomator2 driver
  • Macrobenchmark
  • Baseline Profiles

Supported Platformsโ€‹

UI Automator is Android-only and focuses on cross-app and system-level testing, with Java and Kotlin support.

UI Automator targets the Android platform with Java and Kotlin, running on devices and emulators across app and system boundaries.

  • Android (cross-app)
  • System UI
  • Java
  • Kotlin
  • Real devices
  • Emulators
  • Platform: Android only, with no iOS or cross-platform support.
  • Languages: Java and Kotlin, with Kotlin first-class in the 2.4.0 DSL.
  • Targets: real devices and emulators.
  • Scope: cross-app and system UI in addition to the app under test.
  • Minimum API: API 18, which is Android 4.3, is the documented minimum, with some newer features needing higher levels.
  • Cross-platform note: for iOS and cross-platform, Appium uses UI Automator under the hood for Android.

System Requirementsโ€‹

UI Automator is a lightweight library consumed as a Gradle dependency, with requirements driven by the Android toolchain.

  • Android SDK: a configured Android SDK and build tools are required.
  • Languages: Java or Kotlin, with the AndroidJUnitRunner configured as the test runner.
  • Build system: Gradle with the Android Gradle Plugin.
  • Execution target: a connected physical device, an emulator, or a device cloud.
  • Minimum API level: API 18 or higher.
  • Inspection tooling: the legacy uiautomatorviewer is deprecated, so teams use Android Studio's Layout Inspector or third-party inspectors.

Architectureโ€‹

UI Automator runs out-of-process through the accessibility layer, which is what gives it cross-app and system reach.

  • Out-of-process execution: UI Automator runs outside the app under test, so it can drive system UI and other installed apps and can test release builds.
  • Instrumentation model: tests run through the AndroidJUnitRunner under JUnit4.
  • Element location: elements are found through the accessibility node tree using By and UiObject2 or the legacy UiSelector.
  • Device control: UiDevice provides device-level actions and state control.
  • Synchronization: waiting uses Until conditions and a public Condition interface, with no automatic UI-thread synchronization.
  • Composition: UI Automator composes with Espresso in the same test and is the foundation of Appium's UiAutomator2 driver.

Scripting/Test Implementation Modelโ€‹

UI Automator is a code-first framework written in Java or Kotlin and run through AndroidJUnitRunner.

  • Programming languages: Java and Kotlin, using standard language file extensions.
  • Test framework: JUnit4 with the AndroidJUnit4 runner.
  • Element location: By and UiObject2 for the modern API, or UiSelector and UiObject for the legacy API.
  • Device actions: UiDevice handles Home, Back, notifications, rotation, and screenshots.
  • Waiting: Until conditions and custom Condition implementations keep tests synchronized.
  • Modern DSL: the 2.4.0 line adds a Kotlin DSL with predicate finders and a watchFor mechanism for unexpected dialogs.

Reportingโ€‹

UI Automator produces results through JUnit4 and the AndroidJUnitRunner, which Gradle turns into standard reports.

UI Automator results are produced through JUnit and Gradle, then consumed by CI/CD pipelines and dashboards.

Supported Formats

UI Automator test results are exported through Gradle and compatible tools in the following formats.

  • XML / JUnitCI/CD-parsable result exchange
  • HTMLGradle test reports
  • JSONStructured data via adapters
  • JUnit XML is generated by Gradle for CI consumption in Jenkins, GitHub Actions, and GitLab CI.
  • HTML test reports are produced by Gradle after connectedAndroidTest.
  • Allure reporting is available through community adapters.
  • Firebase Test Lab provides hosted result dashboards, logs, and per-test breakdowns.
  • Screenshots are built in through UiDevice.takeScreenshot, with per-element screenshots in the 2.4.0 DSL.

Observability Metricsโ€‹

  • Screenshots: built in through UiDevice.takeScreenshot, plus per-element and window screenshots in the 2.4.0 DSL.
  • Logs: logcat output is available during instrumented runs.
  • Video: not built into UI Automator, and provided by Firebase Test Lab, Gradle Managed Devices, or device clouds.

Security & Complianceโ€‹

  • UI Automator is a test library that runs locally or in CI against devices and emulators, not a hosted cloud service, so it stores no customer data and exposes no SaaS attack surface of its own.
  • Compliance certifications such as SOC 2, ISO 27001, or GDPR are not applicable to UI Automator itself, since there is no service to certify.
  • Any compliance posture derives from the infrastructure used to run tests, such as your CI or a device cloud.
  • The Apache 2.0 license is permissive and business-friendly.

Releases and Maintenanceโ€‹

  • Current stable: UI Automator 2.3.0, published February 21, 2024, which added multi-display support, new selectors, a Condition interface, and gesture reliability fixes.
  • Next line: the 2.4.0 line introduces a Kotlin DSL with predicate finders, built-in waiting, multi-window testing, and a watchFor mechanism, and it remains in beta as of mid-2026.
  • Release cadence: standard AndroidX alpha, beta, and stable channels through Google Maven.
  • Source hosting: UI Automator source lives in AOSP rather than the android/android-test GitHub repository.

Pricingโ€‹

  • UI Automator is free and open source under the Apache 2.0 license, with no licensing fees, subscription, or paid tier.
  • It is consumed as a Gradle test dependency from Google Maven.
  • Costs only arise from the infrastructure used to run tests, such as physical devices, emulators, or a device cloud.

Usage and Industry Adoptionโ€‹

  • UI Automator is part of AndroidX Test and is used across the Android ecosystem for cross-app and system-level testing.
  • It is the technical foundation of Appium's UiAutomator2 Android driver, the most widely used Appium Android driver.
  • It underpins Macrobenchmark and Baseline Profile generation in the official Android performance tooling.
  • Source lives in AOSP rather than a starred GitHub repository, so no standalone star or download metric is claimed here.

Awards & Recognitionโ€‹

  • Not applicable. As standard, free Android tooling, UI Automator has no notable industry awards on record.
  • It is recognized as part of Google's officially endorsed Android testing toolchain.

Strengthsโ€‹

  • Cross-app and system-level testing that is impossible with Espresso, including notifications, settings, permissions, and multi-app flows.
  • True black-box testing that works without app source code and against release or minified builds.
  • Device-level control over Home and Back, rotation, the notification shade, screenshots, and multiple displays.
  • Composition with Espresso, and it underpins Appium's UiAutomator2 driver.
  • Official Google maintenance, free under Apache 2.0, as part of the standard Android testing stack.

Limitationsโ€‹

  • Android-only, with no iOS or cross-platform support, so cross-platform teams use Appium, which itself sits on UI Automator for Android.
  • Black-box only, which is less precise than Espresso's white-box access and can be flakier.
  • Slower than Espresso for in-app testing, since it runs out-of-process with no automatic UI-thread synchronization, so manual waits are often needed.
  • No built-in reporting or observability, so it relies on the runner, CI, and device clouds.
  • The legacy UiSelector API is verbose, and the modern Kotlin DSL is still in beta as of mid-2026.
  • The old uiautomatorviewer inspector is deprecated, so teams use Android Studio's Layout Inspector or third-party inspectors.

Best Fit Scenariosโ€‹

  • Cross-app and system-level Android testing for flows that leave the app under test.
  • End-to-end flows spanning multiple apps, such as opening an app, sharing to another app, and confirming in Settings.
  • Black-box testing where source code is unavailable, or testing release and minified builds.
  • Complementing Espresso, with UI Automator for the system and cross-app steps and Espresso for precise in-app assertions.
  • Testing notifications, Quick Settings, device Settings, and runtime permission dialogs.