avdmanager
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
avdmanager
— это инструмент командной строки, который позволяет создавать виртуальные устройства Android (AVD) и управлять ими из командной строки. AVD позволяет вам определить характеристики телефона Android, часов Wear OS или устройства Android TV, которые вы хотите имитировать в эмуляторе Android.
Если вы используете Android Studio, вам не нужно использовать этот инструмент, и вместо этого вы можете создавать AVD и управлять ими из IDE .
Инструмент avdmanager
включен в пакет инструментов командной строки Android SDK по адресу android_sdk /cmdline-tools/ version /bin/avdmanager
.
Синтаксис
Чтобы использовать avdmanager
, используйте следующий синтаксис:
avdmanager [global options] command [command options]
Глобальные варианты
Таблица 1. Список глобальных опций avdmanager.
Глобальный вариант | Описание |
---|
-s | --silent | Тихий режим: распечатываются только ошибки. |
-h | --help | Помощь в использовании. |
-v | --verbose | Подробный режим: печатаются ошибки, предупреждения и информационные сообщения. |
--clear cache | Очистите кэш манифеста репозитория SDK Manager. |
Команды и параметры команд
Таблица 2. Список команд и опций avdmanager.
Команда и опции | Описание |
---|
create avd -n name -k " sdk_id " [-c { path | size }] [-f] [-p path ] | Создайте новый AVD. Вы должны указать name AVD и указать идентификатор пакета SDK, который будет использоваться для AVD, используя sdk_id заключенный в кавычки. Например, следующая команда создает test с именем AVD, используя образ системы x86 для уровня API 25: avdmanager create avd -n test -k "system-images;android-25;google_apis;x86" Ниже описано использование других опций:-
-c { path | size } : Путь к образу SD-карты для этого AVD или размер нового образа SD-карты, который необходимо создать для этого AVD, в КБ или МБ, обозначается K или M . Например, -c path/to/sdcard/ или -c 1000M . -
-f : принудительное создание AVD. Используйте эту опцию, если вам нужно перезаписать существующий AVD новым AVD с тем же именем. -
-p path : путь к месту, где будет создан каталог для файлов этого AVD. Если вы не укажете путь, AVD будет создан в ~/.android/avd/ .
|
delete avd -n name | Удалить AVD. Вы должны указать AVD с name . |
move avd -n name [-p path ] [-r new-name ] | Переместите или переименуйте AVD. Вы должны указать AVD с name . Ниже описано использование других опций:-
-p path : абсолютный путь к месту, в котором необходимо создать каталог, в который будут перемещены файлы этого AVD. Если вы не включите этот аргумент, AVD не будет перемещен. Вы можете не включать этот аргумент, если хотите переименовать AVD на месте. -
-r new-name : новое имя переименовываемого AVD.
|
list [target|device|avd] [-c] | Перечислите все доступные цели, определения устройств или AVD. Если вы не укажете target , device или avd , avdmanager выведет список всех трех. Включите аргумент -c , чтобы получить компактный вывод, подходящий для сценариев. Аргумент -c недоступен при перечислении всех трех параметров вместе. |
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-29 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. |"]]