agentleFS
giolaqgiolaq/tv-build-harness/skills/android-tv-testing/SKILL.md

android-tv-testing

Skill4 starsChanged 4 months agoMIT-0View on GitHub

Android TV build and D-pad QA using Android CLI first, with bounded Gradle and ADB fallbacks

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use the official Android CLI as the primary Android automation surface.

    line 9
  2. Very specific:

    Use android skills find <query> and android skills add --skill=<name> when a task needs another Android skill.

    line 23
  3. Distinctive:

    Use the repository's Gradle wrapper for compilation and assembly.

    line 43
  4. Distinctive:

    Use these Android key codes only through the bounded fallback:

    line 79
  5. Distinctive:

    When Android Studio Quail 2 Canary 1 or newer is open with Gemini enabled:

    line 92
  6. Very specific:

    Do not replace android run, android layout, or android screen capture with ADB when Android CLI is available.

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Android TV Testing

Use the official Android CLI as the primary Android automation surface. It standardizes project discovery, SDK/emulator management, deployment, UI layout, screenshots, Android knowledge, agent skills, and Android Studio integration.

Set up the agent

command -v android
android update
android init
android skills list --long

android init installs or updates the android-cli skill for detected agents. Use android skills find <query> and android skills add --skill=<name> when a task needs another Android skill. Use android docs search followed by android docs fetch kb://... instead of relying on remembered Android advice.

Command ownership

ConcernPrimary command
SDK locationandroid info
Project/build metadataandroid describe --project_dir=<dir>
SDK packagesandroid sdk list/install/update
Virtual devicesandroid emulator list/create/start/stop
Install and launch APKandroid run --apks=<apk> --device=<serial>
UI hierarchyandroid layout --pretty --output=<file>
UI changesandroid layout --diff
Screenshotandroid screen capture --output=<png>
IDE inspectionandroid studio check/analyze-file/find-usages
Android guidanceandroid docs search/fetch

Android CLI's run command deploys an already-built APK; it does not compile. Use the repository's Gradle wrapper for compilation and assembly. Android CLI does not currently expose D-pad input, connected-device boot state, or Logcat, so use ADB only for those gaps.

Canonical TV loop

# Discover the generated native project and APK metadata.
android describe --project_dir=<android-project>

# Compile with the project-owned wrapper.
./gradlew :app:compileDebugKotlin
./gradlew :app:assembleDebug

# Deploy and launch with Android CLI.
android run \
  --apks=<apk-from-describe> \
  --device=<serial> \
  --activity=.MainActivity

# Inspect before interaction.
android layout --pretty --output=home.json
android screen capture --output=home.png

# Android CLI has no remote-key command yet.
adb -s <serial> shell input keyevent 22
android layout --diff
android screen capture --output=after-right.png

Focus verification

Capture a layout before and after each D-pad action. Verify that the node marked focused changes. A changed screenshot alone is not sufficient: animation can change pixels while focus remains stuck.

Use these Android key codes only through the bounded fallback:

ActionKey code
Up19
Down20
Left21
Right22
Select23
Back4

Android Studio integration

When Android Studio Quail 2 Canary 1 or newer is open with Gemini enabled:

android studio check
android studio analyze-file app/src/main/java/.../MainActivity.kt
android studio find-declaration --short MainActivity
android studio find-usages --short MainActivity

For Compose projects, use android studio render-compose-preview with --print-semantics to give the agent both an image and accessibility semantics.

Failure handling

SymptomEvidence and action
Compile errorKeep the Gradle output; inspect the affected file with android studio analyze-file when available.
App fails to deployKeep android run output and verify the APK path from android describe.
Empty or wrong screenCapture android layout and a screenshot; verify activity metadata.
Focus does not moveCompare focused nodes before/after input; inspect focus registration and screen activation.
CrashUse adb -s <serial> logcat -d because Android CLI has no Logcat command.

Do not replace android run, android layout, or android screen capture with ADB when Android CLI is available. Do not modify generated native files when an Expo config plugin owns them. Preserve focus-system wiring and tile dimensions while fixing navigation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.