migrating-from-android-test-classes

Community

Migrate deprecated android.test.* to AndroidX

Authorskydoves
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Migrating legacy Android instrumentation tests that rely on deprecated android.test.* classes so they keep running under AndroidX Test and can use modern JUnit4, ActivityScenario, and Espresso.

Core Features & Use Cases

  • Class-by-class migration map: Replaces deprecated InstrumentationTestRunner and legacy test base classes with AndroidX Test equivalents (e.g., AndroidJUnitRunner, AndroidJUnit4 runner, InstrumentationRegistry, ApplicationProvider).
  • Modern replacement patterns: Guides mechanical conversions like ActivityInstrumentationTestCase2 → ActivityScenario, ServiceTestCase → ServiceTestRule, and legacy UI/assert/touch helpers → Espresso matchers/actions and supported assertion libraries.
  • Workflow and verification guidance: Provides a safe migration sequence (flip the runner first, convert one test class at a time) and a checklist to confirm android.test.* references are fully removed.

Quick Start

Use the skill to migrate the entire module by switching testInstrumentationRunner to AndroidJUnitRunner first, then converting one legacy android.test.* test class at a time until the module compiles and tests run.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 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: migrating-from-android-test-classes
Download link: https://github.com/skydoves/android-testing-skills/archive/main.zip#migrating-from-android-test-classes

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.