Firebase Test Lab — what it is, device testing types and automation

Author: IT Sectr Published: 2026-04-29 Reading time: 9 min

Firebase Test Lab is a Google cloud service for automated testing of mobile applications on real devices located in Google data centers. Test Lab allows you to run instrumentation tests, screenshot tests, and robot tests on hundreds of device configurations with different Android and iOS versions without the need to maintain your own device farm. According to Firebase Documentation, 2026, Firebase robot testing automatically goes through all application screens, detecting crashes, ANRs and UI issues without writing a single line of test code. The service supports integration with CI/CD systems and provides detailed reports with videos and logs.

Key Takeaways

  • Firebase Test Lab is a cloud service for testing mobile applications on real devices in Google data centers with pay-per-use billing.
  • Robot tests — automatic app exploration: Firebase Crawler goes through all screens, clicks buttons and fills forms, catching bugs without writing code.
  • Instrumentation tests — running Espresso, XCTest and UI Automator tests on real devices with parallel execution on different configurations.
  • Device matrix — tests run simultaneously on a selected set of devices with different OS versions, screen orientations and languages.
  • Reports — after testing, logs, screenshots, test execution videos and a summary with found errors and performance data are available.

What is Firebase Test Lab

Firebase Test Lab is Google's cloud infrastructure for automated testing of mobile applications on physical devices located in Google's global data centers. Unlike emulators on a local machine, Test Lab runs tests on real Android devices and iOS devices with various operating system versions, screen resolutions, RAM sizes and API levels. The service automatically processes test results, providing execution videos, step screenshots and detailed logs.

Benefits of Cloud Testing

Maintaining your own device farm requires significant capital expenditure on purchasing and maintaining physical devices. Firebase Test Lab provides access to thousands of devices on a pay-per-use basis with a free limit on the Spark plan. Test Lab automatically updates the device pool to current models, including the latest flagship Google Pixel, Samsung Galaxy, Xiaomi and iPhone devices. Tests run in parallel on multiple devices, reducing the overall application verification time.

Supported Platforms

For Android, Test Lab supports testing on devices with API levels from 21 to the latest stable Android version. iOS support includes real iPhone and iPad devices with iOS versions from 15 to the latest stable version. Robot testing and XCTest are available for iOS. Each test can be run on physical devices or emulators — for the most accurate results, Google recommends using physical devices as they reveal issues with sensors, camera and network interfaces.

Test Types in Firebase Test Lab

Firebase Test Lab supports several test types, each solving its own task in the development cycle: robot tests for quick stability checks, instrumentation tests for functional verification, and screenshot tests for detecting visual regressions. The choice of test type depends on the development stage and goals of a particular run.

Robot Tests (Robo tests)

Robot tests are a unique feature of Firebase Test Lab that does not require writing test code. Firebase Crawler automatically explores the application: finds all interactive UI elements, clicks on them, fills forms with test data, navigates between screens and records any failures (crash, ANR, exceptions). Robot tests detect up to 80% of critical bugs without a single line of test code, making them an ideal tool for assessing the basic stability of an application in the early stages of development.

Instrumentation Tests

Instrumentation tests are tests written by the developer using Espresso (Android) or XCTest (iOS) frameworks. Test Lab runs the APK with tests on the target device and collects execution results. Tests can be simple (checking element display) or complex (end-to-end scenarios: login, add to cart, checkout). Firebase Test Lab supports Android Test Orchestrator for isolating tests from each other, preventing one failed test from affecting the others.

Screenshot Tests (Game loop and screenshots)

Screenshot tests are used to detect visual regressions in the application. Game loop is a special test type that passes a list of scenarios to the application via intent, and the application must execute these scenarios and take screenshots of key screens. Test Lab collects screenshots from all devices in the matrix and allows comparing them with reference images to detect differences. This test type is especially popular in gaming applications for checking rendering on different GPUs.

Test TypeCodeWhat It ChecksWhen to Use
Robot TestNot requiredCrash, ANR, exceptionsQuick stability check
InstrumentationEspresso / XCTestScenario functionalityRegression testing
Screenshot TestGame loopVisual regressionsUI checking on different devices

Device Matrix and Configurations

Testing matrix in Firebase Test Lab is a set of device configurations on which the selected test is executed. Each configuration includes the device model, OS version, screen orientation (portrait/landscape) and regional settings (locale, language). The test runs in parallel on all selected configurations, significantly reducing the total execution time compared to sequential running on each device.

Choosing Devices for the Matrix

Google recommends including devices with different characteristics in the matrix: a flagship model (Google Pixel, Samsung Galaxy S), a budget device (Moto G, Xiaomi Redmi), a device with the minimum API version supported by the application. An optimal matrix includes 5–10 configurations covering all OS versions that the application supports. For iOS, iPhone and iPad models of different generations are selected (e.g., iPhone SE, iPhone 14, iPad Air) with different iOS versions.

Test Grouping and Parallelism

Test Lab automatically distributes tests across selected devices, running each test on each configuration. The execution time of the entire matrix equals the execution time of the slowest test on the slowest device — all others run in parallel. If one test fails on all devices, Test Lab stops its execution on the remaining configurations to save resources. Results are grouped by test and by device, allowing quick identification of whether an error is specific to a particular configuration.

Robot Testing: Automatic Exploration

Robot testing is a flagship feature of Firebase Test Lab that allows you to automatically explore an application without writing a single test. Firebase Crawler (robot) analyzes the application's UI hierarchy, finds all interactive elements (buttons, text fields, lists, menus) and interacts with them, simulating real user behavior. Robot testing is especially effective in the early stages of development, when tests have not yet been written, or for checking legacy code.

Setting Up a Robot Test

To run a robot test, simply upload an APK or IPA to Firebase Console and select the Robo test option. The robot can automatically log into the application through pre-configured credentials (login/password) to access screens hidden behind authentication. You can also set the exploration depth (max depth) to limit the number of robot steps, or specify specific elements that the robot should click on with priority.

xml
<!-- res/xml/robo_directives.xml -->
<!-- The robot will fill in the login and password fields -->
<?xml version="1.0" encoding="utf-8"?>
<robo-directives
    xmlns:android="http://schemas.android.com/apk/res/android">
    <directive
        android:resourceName="@id/et_email"
        android:inputValue="test@example.com" />
    <directive
        android:resourceName="@id/et_password"
        android:inputValue="password123" />
    <directive
        android:resourceName="@id/btn_login"
        android:clickAction="CLICK" />
</robo-directives>

Limitations of Robot Tests

Robot tests do not replace manual testing and written instrumentation tests for complex scenarios. The robot cannot check business logic: it clicks on all elements in sequence, but does not know if the result is correct. Also, the robot cannot interact with custom views that do not inherit from standard ViewGroup, and does not handle WebView. For these cases, instrumentation tests or Game loop must be used.

CI/CD and Gradle Integration

Firebase Test Lab integration with CI/CD systems allows you to automatically run tests with every push to the repository. Test Lab supports Gradle tasks for Android and Fastlane for both platforms. Setting up a CI/CD pipeline includes building the application, uploading the APK/IPA to Google Cloud Storage, running tests via Firebase CLI and getting reports back to the CI system for displaying build status.

Setup via Gradle (Android)

Google provides the gcloud-test-lab plugin for Gradle, which automates test uploading and execution. The assembleAndroidTest task builds the APK with tests, and gcloud tasks upload it to Test Lab and run the matrix. Test results are returned to Gradle as pass/fail, allowing Test Lab integration into any CI pipeline that supports Gradle. A Firebase service account with Test Lab permissions is used for authorization.

groovy
// build.gradle (module: app)
task runTestLab() {
    exec {
        commandLine "gcloud", "firebase", "test", "android", "run",
            "--type", "robo",
            "--app", "build/outputs/apk/debug/app-debug.apk",
            "--device", "model=Pixel7,version=33",
            "--device", "model=GalaxyS23,version=34",
            "--device", "model=RedmiNote12,version=31",
            "--timeout", "15m",
            "--results-dir", "firebase/test-lab/robo"
    }
}

Setup via Fastlane

Fastlane provides the firebase_test_lab plugin for integration with iOS and Android tests. A Fastlane lane performs the build, runs tests and processes results. For iOS XCTest, Test Lab requires an xctestrun file, which is created automatically when building the test target. Fastlane can also upload test results to Slack or other messengers to notify the team about testing status after each run.

Test Results Analysis

After test completion, Firebase Test Lab provides a comprehensive report available in Firebase Console and via gcloud CLI. The report includes a brief summary (number of passed, failed and skipped tests), detailed information for each test on each device, execution videos, screenshots of key steps and device logs (logcat for Android, system log for iOS). For failed tests, a stack trace with the exact error location is available.

Interpreting Robot Test Results

For a robot test, the report differs from an instrumentation one: instead of pass/fail per test case, the report shows exploration statistics. Key metrics — the number of found and visited screens, the number of robot interactions (clicks, swipes, text input), detected crashes and ANRs, and the path traversed through the application. The robot execution video allows you to visually assess which screens were tested and which remained uncovered.

Exporting Results

Test results are stored in Google Cloud Storage in the project's associated bucket. The data is available for export and integration with external analytics systems. For long-term storage and comparison of results between runs, it is recommended to set up BigQuery export or use the Firebase Test Lab API for programmatic result retrieval. Google provides the ability to download a ZIP archive with the full set of results for each test run.

Frequently Asked Questions

How much does Firebase Test Lab cost?

Spark plan includes 10 Robo tests per day and 5 hours of instrumentation tests per month for free. Blaze plan is charged by time: ~1 USD per device-hour for Robo tests and ~5 USD for instrumentation tests. The exact cost depends on the region and device type.

How do physical devices differ from emulators in Test Lab?

Physical devices provide more accurate results, including issues with sensors, camera, GPS, Bluetooth and real performance. Emulators start faster and are cheaper, but do not reveal problems related to hardware features. Google recommends physical devices for pre-release testing.

How to set up authorization for a robot test?

Create an XML file robo_directives.xml with input fields (login, password) and buttons to click. Upload the file together with the APK when starting the test via Firebase Console or CLI. The robot will perform the specified actions before starting the exploration.

Can I run tests on iOS in Firebase Test Lab?

Yes, Firebase Test Lab has supported iOS since 2024. Robo tests (automatic exploration) and XCTest (instrumentation tests) are available on real iPhone and iPad devices. An IPA file with a test target is required for upload.

How to integrate Test Lab with GitHub Actions?

Use Firebase CLI in GitHub Actions: set up authentication via Service Account JSON, install the gcloud SDK, run the firebase test android run command with the APK and configurations. Test results are available via Firebase Console or gcloud CLI.

Summary

  • Firebase Test Lab is a Google cloud service for testing mobile applications on real devices with pay-per-use billing.
  • Three test types — robot tests (no code, automatic exploration), instrumentation tests (Espresso, XCTest) and screenshot tests (Game loop) for different verification tasks.
  • Device matrix allows running tests in parallel on a set of configurations (model + OS version + orientation), reducing total verification time.
  • Robot tests (Firebase Crawler) automatically explore the application, detecting up to 80% of critical bugs without writing a single line of test code.
  • CI/CD integration — Test Lab supports Gradle, Fastlane and Firebase CLI for automatic test execution with every push to the repository.
  • Detailed reports include execution videos, screenshots, device logs and stack traces for each failed test on each configuration.
  • Free tier — 10 Robo tests per day on the Spark plan, sufficient for basic stability checking of the application in the daily development cycle.

We will develop a mobile application turnkey

IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.

Discuss the project

Read also