Learn how to write Espresso tests that tap buttons, fill text fields, and verify what appears on screen in an Android app.
Use UiAutomator examples to test your app from the outside by simulating real user gestures.
Find a reference example when adding a specific kind of automated test to your own Android project.
Requires Android Studio and either a connected Android device or a running emulator to execute the tests.
This repository is a collection of small example projects maintained by the Android team at Google. Each example demonstrates a specific approach to automated testing for Android apps. The goal is to show developers the different tools and frameworks available for checking that their apps work correctly before shipping them to users. The examples cover several testing tools. Espresso is used for testing what users see and interact with on screen, such as buttons, lists, and text inputs. The collection includes more than a dozen Espresso examples, ranging from basic interaction tests to more complex scenarios like handling multiple windows, background tasks, and camera simulations. There is also a UiAutomator example, which tests the app from the outside by simulating real user gestures. Additional examples cover how to run tests using the standard Android test runner and how to apply rules that manage the app lifecycle during testing. To run any of these examples, you need Android Studio or a compatible build environment. The projects use Gradle for building. You can run tests either on a connected physical device or on an emulator. The README includes the exact commands needed. There is also experimental support for Bazel, an alternative build system, though that support is Linux-only and still marked as unofficial. This repository is primarily useful for Android developers who want to learn by example how to write automated tests, or who need a reference when setting up testing in their own projects. Non-technical readers are unlikely to find the content directly useful, as the repository contains only code and instructions aimed at developers.
← android on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.