running-instrumented-tests-with-androidjunit4

Installation
SKILL.md

Running Instrumented Tests with AndroidJUnit4 — Get the Runner Stack Right

Instrumentation tests fail before any assertion runs when the runner stack is misconfigured: a deprecated AndroidJUnit4 import, the orchestrator on androidTestImplementation instead of androidTestUtil, the deprecated androidx.test.InstrumentationRegistry instead of androidx.test.platform.app.InstrumentationRegistry. This skill encodes the exact dependency matrix, the runner Gradle config, and the supporting annotations and rules.

When to use this skill

  • The IDE flags androidx.test.runner.AndroidJUnit4 as @Deprecated, or the test compiles but emits the deprecation warning.
  • am instrument returns INSTRUMENTATION_FAILED: <pkg>/androidx.test.runner.AndroidJUnitRunner or Test runner not found.
  • Test Orchestrator is configured in Gradle but tests still share a single instrumentation process (orchestrator silently disabled).
  • The user passes -e size small / -e package com.foo via am instrument and the test ignores it — RunnerArgs is unwired.
  • A test needs ACCESS_FINE_LOCATION / RECORD_AUDIO etc. and the user is hand-rolling permission grants from adb.
  • The user wants to skip a test below API 26 and is searching for the annotation.

When NOT to use this skill

Installs
40
GitHub Stars
319
First Seen
May 16, 2026
running-instrumented-tests-with-androidjunit4 — skydoves/android-testing-skills