android-cli

Manages Android SDKs, emulators, devices, and documentation through the android CLI.

3|Updated Aug 4, 2024
One-click install
npx skills add https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform --skill android-cli-kabindra-shrestha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-cli
Source: https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform/tree/main/.agents/skills/devtools/android-cli
Command: npx skills add https://github.com/kabindra-shrestha/Clean-Architecture-Kotlin-Compose-Multiplatform --skill android-cli-kabindra-shrestha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up and interacting with Android development environments requires juggling many separate tools for SDK management, emulator control, device interaction, and documentation lookup. This Skill consolidates those workflows into instructions for a single android command-line tool. ## Core Features & Use Cases - SDK and Emulator Management: Install, update, and remove SDK packages, and create, start, stop, and list Android Virtual Devices (AVDs). - Device Interaction and UI Inspection: Capture screenshots, dump UI layout trees as JSON, and interact with on-screen elements via adb input commands. - Project Creation and App Deployment: Generate new Android projects from templates and deploy APKs to connected devices. - Documentation Search and Journey Testing: Query the Android Knowledge Base for up-to-date API guidance and execute XML-defined journey tests against running apps. - Use Case: You need to verify a new feature on a Pixel emulator. Use this Skill to create and start an AVD, deploy your APK, inspect the layout tree to find a button, tap it, and capture a screenshot to confirm the result. ## Quick Start Install the android CLI and use it to create a new emulator, run my app on it, and capture a screenshot of the result.

Frequently Asked Questions about android-cli

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

FAQPage Schema
How do I install the android CLI tool?

Install the android CLI by running the platform-specific curl command from Google's download server. On Linux use the linux_x86_64 install script, on macOS use darwin_arm64 or darwin_x86_64, and on Windows download and run the install.cmd file.

How do I create and start an Android emulator from the command line?

Use the android emulator command group to manage virtual devices. Run android emulator create to make a new AVD, android emulator start to launch it, and android emulator list to see available devices.

How do I inspect the UI layout of a running Android app?

Run android layout to get the UI element tree as JSON, including text, resource IDs, bounds, and interaction states. Use android layout --diff to see only elements that changed since the last call, which keeps output small.

Can I capture screenshots of an Android device from the CLI?

Yes, run android screen capture -o <file path> to save the current device screen as a PNG. Adding --annotate draws numbered labels and bounding boxes around UI elements, which you can resolve to coordinates with android screen resolve.

What is a journey test in Android development?

A journey is an XML-specified test of an app's behavior made of sequential action elements. Each action is executed exactly as written, and the journey fails if any action cannot be performed or a verification expectation is not met.

Why does android layout fail to return UI elements?

The layout command can fail when the app displays a WebView or an active animation. In those cases, use android screen capture --annotate to inspect the screen visually instead, or navigate away and retry.