running-tests-on-gradle-managed-devices

Configure Gradle Managed Devices to run instrumented Android tests on build-owned emulators.

303|10|Updated May 15, 2026
One-click install
npx skills add https://github.com/skydoves/android-testing-skills --skill running-tests-on-gradle-managed-devices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: running-tests-on-gradle-managed-devices
Source: https://github.com/skydoves/android-testing-skills/tree/main/instrumentation/managed-devices/running-tests-on-gradle-managed-devices
Command: npx skills add https://github.com/skydoves/android-testing-skills --skill running-tests-on-gradle-managed-devices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Gradle Managed Devices lets you run instrumented Android tests on a reproducible emulator environment without manually creating, starting, and maintaining AVDs for CI.

Core Features & Use Cases

  • Version-controlled emulator provisioning: Define devices with the android.testOptions.managedDevices { localDevices { create(...) } } DSL so every run uses the same device configuration.
  • Reliable CI execution: Run generated tasks like <deviceName>DebugAndroidTest, <groupName>GroupDebugAndroidTest, and allDevicesCheck, while Gradle handles download, boot, test execution, and teardown.
  • Cheaper CI with ATD images and sharding: Use Automated Test Device (ATD) images (aosp-atd, google-atd) for headless, faster boots and shard slow suites across managed-device copies for parallelism.

Quick Start

Ask your AI coding agent to set up Gradle Managed Devices in build.gradle.kts with an ATD-based managed device and then run the generated <deviceName>DebugAndroidTest task so CI automatically provisions, boots, tests, and tears down the emulator.

Frequently Asked Questions about running-tests-on-gradle-managed-devices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run instrumented Android tests on CI without manually managing AVDs?

Gradle Managed Devices run instrumented Android tests on reproducible, build-owned emulators without hand-managed AVDs. Gradle automatically handles emulator download, boot, test execution, and teardown for reliable CI pipelines.

What are ATD images and how do they speed up CI emulator test runs?

Automated Test Device (ATD) images like aosp-atd and google-atd provide headless, faster-booting emulators for CI. They reduce overhead and cost when running generated Android test tasks in automated pipelines.

How do I configure Gradle Managed Devices for multiple API levels in build.gradle.kts?

Define devices using the android.testOptions.managedDevices localDevices create DSL in build.gradle.kts. This version-controlled provisioning ensures every run uses the same device configuration across API levels.

Can I parallelize slow instrumented test suites using Gradle Managed Devices?

Yes, you can parallelize slow suites using test sharding across managed-device copies. Sharding distributes tests to run concurrently, significantly reducing execution time for slow instrumented suites.

What Gradle tasks are generated for running grouped Android instrumented tests?

Gradle generates tasks like deviceNameDebugAndroidTest, groupNameGroupDebugAndroidTest, and allDevicesCheck. These tasks automate device provisioning, test execution, teardown, and report generation across device groups.

Does Gradle Managed Devices support headless test execution for continuous integration?

Yes, Gradle Managed Devices support headless CI execution using ATD system images. This approach ensures reproducible environments and faster boots without requiring a graphical interface for emulator display.