running-instrumented-tests-with-androidjunit4

Configure AndroidX Test dependencies and AndroidJUnit4 runner settings for instrumentation tests.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill running-instrumented-tests-with-androidjunit4-trancee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: running-instrumented-tests-with-androidjunit4
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/android-testing-skills/instrumentation/runner/running-instrumented-tests-with-androidjunit4
Command: npx skills add https://github.com/trancee/MeshLink-template --skill running-instrumented-tests-with-androidjunit4-trancee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves common configuration failures in Android instrumentation testing, such as deprecated runner imports, silent Test Orchestrator misconfigurations, and incorrect dependency wiring that lead to test execution failures.

Core Features & Use Cases

  • Dependency Management: Provides the exact coordinate matrix for AndroidX Test libraries to ensure compatibility.
  • Runner Optimization: Guides the correct setup of the AndroidJUnitRunner and Test Orchestrator to ensure isolated, reliable test execution.
  • Use Case: Use this skill when your instrumentation tests fail to launch with errors like Test runner not found or when you need to correctly implement runtime permission grants and SDK suppression for cross-version testing.

Quick Start

Use the running-instrumented-tests-with-androidjunit4 skill to configure the correct AndroidX Test dependencies and runner settings for my current module.

Frequently Asked Questions about running-instrumented-tests-with-androidjunit4

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

FAQPage Schema
Why does my Android instrumentation test fail with a test runner not found error?

Android instrumentation tests fail when using deprecated runner imports or incorrect dependency wiring. Configuring the correct AndroidJUnit4 runner and AndroidX Test libraries resolves these execution failures by ensuring the proper test stack is loaded.

How do I configure AndroidX Test libraries for isolated instrumentation tests?

To configure isolated Android instrumentation tests, apply the exact AndroidX Test library coordinate matrix and enable Test Orchestrator. This setup ensures reliable, hermetic on-device test execution across application and library modules.

Can I use GrantPermissionRule to handle runtime permissions in AndroidJUnit4 tests?

Yes, you can implement runtime permission grants using GrantPermissionRule within AndroidJUnit4 tests. Correctly configuring the AndroidX Test stack ensures these rules function properly during on-device test execution.

What is the best way to ensure hermetic on-device test execution for an Android library module?

The best way to ensure hermetic on-device test execution is configuring the AndroidJUnit4 runner with Test Orchestrator. This approach provides reliable, isolated instrumentation tests by applying correct Gradle configuration for test utilities.