Aller au contenu
Skillpedia
Applis mobiles10k · #11915

android-cli

Ce qu’il fait

Ce skill guide l'installation et l'utilisation de l'outil en ligne de commande android. Il aide à créer des projets Android, à installer des applications sur des appareils, à gérer les émulateurs et les composants du SDK. Il s'adresse aux développeurs Android qui travaillent depuis un terminal.

Quand l’utiliser

  • ✓Quand vous voulez créer un nouveau projet Android depuis la ligne de commande.
  • ✓Quand vous avez besoin d'installer un APK sur un appareil ou un émulateur et de le lancer.
  • ✓Quand vous voulez installer ou mettre à jour des paquets du SDK Android depuis un terminal.

Lien du skill

https://github.com/android/skills/blob/main/devtools/android-cli/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/android/skills/blob/main/devtools/android-cli/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Installe l'outil en ligne de commande android et configure les paquets du SDK dont j'ai besoin pour ce projet.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Le skill vérifie d'abord si l'outil android est dans votre chemin et l'installe si ce n'est pas le cas. Il donne ensuite les commandes pour la gestion du SDK, la création de projets et les tâches sur les appareils.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

This skill provides instructions for using the android CLI tool. The tool includes various commands for creating projects, running applications, interacting with devices, and managing the CLI environment.

Installation

If the android tool is not in the path, install it. To install run the following command:

SDK management

To manage the installation of Android SDKs and tools, use the sdk command. For example:

  • android sdk install <package>[@<version>]...: Install specific packages. Multiple packages can be specified, separated by spaces. <version> defaults to latest. For example: android sdk install platforms/android-30@2 platforms/android-34
  • android sdk update [<pkg-name>]: Update a specific package or all packages to the latest version.
  • android sdk remove <pkg-name>: Remove a package from the local SDK.
  • android sdk list --all: List installed and available SDK packages.

Project creation

Create projects from templates using the create command.

For example: android create empty-activity --name="My App" --output=./my-app

Interacting with Android devices

Use the android layout command to inspect the UI layout of an Android application in JSON format. Use the android screen command to visually inspect the UI and obtain bounding coordinates for visual regions. android layout dumps the UI as JSON. android screen capture -o <file path> saves a PNG. Both auto-select the device when only one is connected; with more than one, pass --device=<serial> (use adb devices to list serials).

UI Dump

android layout returns a JSON tree of the UI elements on screen.

Each JSON object represents a UI element in the Android app. The following properties may be present:

  • text - any literal text the element contains
  • resource-id - the Android resource id used to refer to the element
  • content-desc - a description of a UI element for use by accessibility tools
  • interactions - the set of user interactions the element supports. May contain one or more of: CHECKABLE, CLICKABLE, FOCUSABLE, SCROLLABLE, LONG-CLICKABLE, PASSWORD
  • state - the set of states the element is in. May contain one or more of CHECKED, FOCUSED, SELECTED
  • bounds - the screen coordinates of the bounding rectangle of the element, in the format [min X,min Y][max X, max Y]
  • center - the screen coordinates of the center of the element, in the format [x,y]
  • off-screen - if true, the element is in the UI hierarchy but not within the bounds of the screen; it may require scrolling to view.
  • hidden - if true, the element is in the UI hierarchy but not visible or interactive on screen.

Use layout as a primary means of examining an Android app.

By default, layout only returns elements that have content or are interactive:

  • elements with non-empty text or content-desc properties
  • elements with non-empty interactions or state To return all elements, use the --full flag

If layout continues to fail, use android screen capture --annotate to inspect the app.

Screenshot

android screen capture -o <file path> (or --output=<file path>) saves a PNG of the current device screen to <file path>.

Use screen capture as a secondary means of examining an Android app Examples:

  • Understanding the content of an on-screen image
  • Looking at a WebView (web content does not always appear in the ui dump)
  • Trying to find a UI element by its visual appearance

IMPORTANT : Always VISUALLY examine the PNG image returned from any android screen command BEFORE doing anything else.

Annotated Screenshot

android screen capture --annotate -o <file path> (or -a -o <file path>) android screen resolve --screenshot <path> --string <string>

The --annotate command adds numerical labels and bounding boxes around UI elements. Use this command to locate UI elements that cannot be located in the layout output.

To refer to these labels in i

Questions fréquentes

Quels systèmes peuvent l'installer ?

Le skill présente des installateurs pour Linux, Mac et Windows, avec des versions pour les processeurs Intel et ARM lorsque c'est pertinent.

Peut-il gérer les émulateurs ?

Oui. L'outil peut gérer les appareils virtuels Android, y compris prendre des captures d'écran et inspecter l'écran.

Comment mettre à jour les paquets du SDK ?

Utilisez la commande android sdk update, qui met à jour un paquet précis ou tous les paquets vers la dernière version.

Détails

Description originale de l’auteur

Provides instructions for installing and using the `android` CLI. The `android` command-line tool is a critical tool for Android development and helps you create new Android projects, install APKs onto devices and emulators and launch and run apps on them, manage and interact with Android virtual devices (including screenshots and UI inspection), manage Android SDK components, look up official Android documentation, and discover and install official Android skills.

repo: android/skills

Popularité

Étoiles GitHub
10k
Position au classement
#11915
Licence
Apache-2.0
Mis à jour
29/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires