avdmanager
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
avdmanager
adalah alat command line yang memungkinkan Anda membuat dan mengelola
Perangkat Virtual Android (AVD) dari command line. AVD memungkinkan Anda menentukan
karakteristik handset Android, smartwatch Wear OS, atau perangkat Android TV
yang ingin Anda simulasikan di Android Emulator.
Jika menggunakan Android Studio, Anda tidak perlu menggunakan alat ini dan
sebagai gantinya, Anda dapat
membuat dan mengelola AVD dari IDE.
Alat avdmanager
disertakan dalam paket Alat Command Line Android SDK
di
android_sdk/cmdline-tools/version/bin/avdmanager
.
Sintaksis
Untuk menggunakan avdmanager
, gunakan sintaksis berikut:
avdmanager [global options] command [command options]
Opsi global
Tabel 1. Daftar opsi global untuk
avdmanager.
Opsi global
|
Deskripsi
|
-s | --silent
|
Mode senyap: hanya error yang akan ditampilkan.
|
-h | --help
|
Bantuan penggunaan.
|
-v | --verbose
|
Mode panjang: error, peringatan, dan pesan informasi akan ditampilkan.
|
--clear cache
|
Menghapus cache manifes repositori SDK Manager.
|
Perintah dan opsi perintah
Tabel 2. Daftar perintah dan opsi
untuk avdmanager.
Perintah dan opsi
|
Deskripsi
|
create avd -n name -k "sdk_id" [-c
{path|size}] [-f] [-p path]
|
Membuat AVD baru. Anda harus memberikan name untuk AVD dan
menentukan ID paket SDK yang akan digunakan untuk AVD menggunakan
sdk_id tanda kutip.
Misalnya, perintah berikut akan membuat AVD bernama test
menggunakan image sistem x86 untuk API level 25:
avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"
Berikut ini penjelasan penggunaan opsi lainnya:
-
-c {path|size} : Jalur ke image kartu
SD untuk AVD ini atau ukuran image kartu SD baru yang akan dibuat
untuk AVD ini, dalam KB atau MB, yang ditandai dengan K atau
M . Misalnya, -c path/to/sdcard/ atau
-c 1000M .
-
-f : Memaksa pembuatan AVD. Gunakan opsi ini jika Anda
perlu menimpa AVD yang ada dengan AVD baru dengan nama yang sama.
-
-p path : Jalur ke lokasi
pembuatan direktori untuk file AVD ini. Jika Anda tidak menentukan
jalur, AVD akan dibuat di
~/.android/avd/ .
|
delete avd -n name
|
Menghapus AVD. Anda harus menentukan AVD dengan name.
|
move avd -n name [-p path] [-r
new-name]
|
Memindahkan atau mengganti nama AVD. Anda harus menentukan AVD dengan name.
Berikut ini penjelasan tentang penggunaan opsi lainnya:
-
-p path : Jalur absolut ke lokasi pembuatan
direktori tempat file AVD ini akan dipindahkan. Jika
Anda tidak menyertakan argumen ini, AVD tidak akan dipindahkan. Anda boleh
memilih untuk tidak menyertakan argumen ini jika ingin mengganti nama AVD di
tempat.
-
-r new-name : Nama baru AVD yang
diganti namanya.
|
list [target|device|avd] [-c]
|
Mencantumkan semua target, definisi perangkat, atau AVD yang tersedia. Jika Anda tidak
menentukan target , device , atau avd ,
avdmanager akan mencantumkan ketiganya. Sertakan argumen -c
untuk menerima output ringkas yang cocok untuk skrip. Argumen
-c tidak tersedia saat mencantumkan ketiga opsi
bersama-sama.
|
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-27 UTC."],[],[],null,["# avdmanager\n\nThe `avdmanager` is a command-line tool that lets you create and manage\nAndroid Virtual Devices (AVDs) from the command line. An AVD lets you define the\ncharacteristics of an Android handset, Wear OS watch, or Android TV device\nthat you want to simulate in the Android Emulator.\n\nIf you're using Android Studio, then you don't need to use this tool and you\ncan instead\n[create and manage AVDs from the IDE](/studio/run/managing-avds).\n\nThe `avdmanager` tool is included in the Android SDK Command-Line Tools package\nat\n\u003cvar translate=\"no\"\u003eandroid_sdk\u003c/var\u003e`/cmdline-tools/`\u003cvar translate=\"no\"\u003eversion\u003c/var\u003e`/bin/avdmanager`.\n\nSyntax\n------\n\nTo use `avdmanager`, use the following syntax: \n\n```\navdmanager [global options] command [command options]\n```\n\n### Global options\n\n**Table 1.** List of global options for\navdmanager.\n\n| Global option | Description |\n|---------------------|-------------------------------------------------------------------------|\n| `-s` \\| `--silent` | Silent mode: only errors are printed out. |\n| `-h` \\| `--help` | Usage help. |\n| `-v` \\| `--verbose` | Verbose mode: errors, warnings, and informational messages are printed. |\n| `--clear cache` | Clear the SDK Manager repository manifest cache. |\n\n### Commands and command options\n\n**Table 2.** List of commands and options\nfor avdmanager.\n\n| Command and options | Description |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `create avd -n `\u003cvar translate=\"no\"\u003ename\u003c/var\u003e` -k \"`\u003cvar translate=\"no\"\u003esdk_id\u003c/var\u003e`\" [-c {`\u003cvar translate=\"no\"\u003epath\u003c/var\u003e`|`\u003cvar translate=\"no\"\u003esize\u003c/var\u003e`}] [-f] [-p `\u003cvar translate=\"no\"\u003epath\u003c/var\u003e`]` | Create a new AVD. You must provide a \u003cvar translate=\"no\"\u003ename\u003c/var\u003e for the AVD and specify the ID of the SDK package to use for the AVD using \u003cvar translate=\"no\"\u003esdk_id\u003c/var\u003e wrapped in quotes. For example, the following command creates an AVD named `test` using the x86 system image for API level 25: ``` avdmanager create avd -n test -k \"system-images;android-25;google_apis;x86\" ``` The following describes the usages for the other options: - `-c {`\u003cvar translate=\"no\"\u003epath\u003c/var\u003e`|`\u003cvar translate=\"no\"\u003esize\u003c/var\u003e`}`: The path to the SD card image for this AVD or the size of a new SD card image to create for this AVD in KB or MB, denoted with `K` or `M`. For example, `-c path/to/sdcard/` or `-c 1000M`. - `-f`: Force creation of the AVD. Use this option if you need to overwrite an existing AVD with a new AVD using the same name. - `-p `\u003cvar translate=\"no\"\u003epath\u003c/var\u003e: Path to the location where the directory for this AVD's files will be created. If you don't specify a path, the AVD is created in `~/.android/avd/`. |\n| `delete avd -n `\u003cvar translate=\"no\"\u003ename\u003c/var\u003e | Delete an AVD. You must specify the AVD with \u003cvar translate=\"no\"\u003ename\u003c/var\u003e. |\n| `move avd -n `\u003cvar translate=\"no\"\u003ename\u003c/var\u003e` [-p `\u003cvar translate=\"no\"\u003epath\u003c/var\u003e`] [-r `\u003cvar translate=\"no\"\u003enew-name\u003c/var\u003e`]` | Move or rename an AVD. You must specify the AVD with \u003cvar translate=\"no\"\u003ename\u003c/var\u003e. The following describes the usages for the other options: - `-p `\u003cvar translate=\"no\"\u003epath\u003c/var\u003e: The absolute path to the location at which to create the directory where this AVD's files will be moved. If you don't include this argument, the AVD won't be moved. You might choose not to include this argument if you want to rename the AVD in place. - `-r `\u003cvar translate=\"no\"\u003enew-name\u003c/var\u003e: The new name of the AVD being renamed. |\n| `list [target|device|avd] [-c]` | List all available targets, device definitions, or AVDs. If you don't specify `target`, `device`, or `avd`, `avdmanager` lists all three. Include the `-c` argument to receive a compact output suitable for scripts. The `-c` argument is not available when listing all three options together. |"]]