Langsung ke konten
Skillpedia
Aplikasi mobile10k · #11915

android-cli

Fungsinya

Skill ini memandu pemasangan dan penggunaan alat baris perintah android. Skill membantu membuat proyek Android, memasang aplikasi di perangkat, mengelola emulator, dan mengatur komponen SDK. Skill ditujukan bagi pengembang Android yang bekerja dari terminal.

Kapan dipakai

  • ✓Saat Anda ingin membuat proyek Android baru dari baris perintah.
  • ✓Ketika Anda perlu memasang APK di perangkat atau emulator lalu menjalankannya.
  • ✓Ketika Anda ingin memasang atau memperbarui paket Android SDK dari terminal.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/android/skills/blob/main/devtools/android-cli/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Pasang alat baris perintah android dan atur paket SDK yang saya butuhkan untuk proyek ini.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill pertama-tama memeriksa apakah alat android ada di path Anda, dan memasangnya jika belum ada. Lalu ia memberikan perintah untuk pengelolaan SDK, pembuatan proyek, dan tugas perangkat.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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

Pertanyaan umum

Sistem apa saja yang bisa memasangnya?

Skill mencantumkan pemasang untuk Linux, Mac, dan Windows, dengan versi untuk prosesor Intel dan ARM bila relevan.

Bisakah ia mengelola emulator?

Bisa. Alat ini dapat mengelola Android virtual device, termasuk mengambil tangkapan layar dan memeriksa layar.

Bagaimana cara memperbarui paket SDK?

Gunakan perintah android sdk update, yang memperbarui satu paket atau semuanya ke versi terbaru.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
10k
Peringkat
#11915
Lisensi
Apache-2.0
Diperbarui
29/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa