running-instrumented-tests-via-adb

Community

Run instrumented tests with adb, no Gradle

Authorskydoves
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you run Android instrumented tests from CI or scripts using adb, avoiding Gradle and preventing misleading outcomes when tests fail.

Core Features & Use Cases

  • Run instrumented tests via adb shell am instrument using the required -w (wait) and -r (raw output) flags for reliable CI consumption.
  • Select and slice test runs with -e arguments such as class, class#method, package, and sharding via numShards/shardIndex.
  • Use AndroidX Test Orchestrator correctly with the proper runner/target wiring (-e targetInstrumentation ... plus the orchestrator as the positional last argument), including clearPackageData.
  • Detect real pass/fail by parsing INSTRUMENTATION_STATUS_CODE (e.g., -2 failure, -1 error) instead of trusting the shell exit code.

Quick Start

Run your single test method directly from a script by calling adb shell am instrument -w -r -e class com.example.MyTest#myMethod com.example.app.test/androidx.test.runner.AndroidJUnitRunner.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: running-instrumented-tests-via-adb
Download link: https://github.com/skydoves/android-testing-skills/archive/main.zip#running-instrumented-tests-via-adb

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.