avdmanager
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
avdmanager
เป็นเครื่องมือบรรทัดคำสั่งที่ช่วยให้คุณสร้างและจัดการ
Android Virtual Device (AVD) จากบรรทัดคำสั่ง AVD ช่วยให้คุณกำหนด
ลักษณะของโทรศัพท์ Android, นาฬิกา Wear OS หรืออุปกรณ์ Android TV
ที่ต้องการจำลองในโปรแกรมจำลอง Android
หากใช้ Android Studio คุณไม่จําเป็นต้องใช้เครื่องมือนี้
สามารถแทน
สร้างและจัดการ AVD จาก IDE
เครื่องมือ avdmanager
รวมอยู่ในแพ็กเกจเครื่องมือบรรทัดคำสั่ง SDK สำหรับ Android
ที่
android_sdk/cmdline-tools/version/bin/avdmanager
วากยสัมพันธ์
หากต้องการใช้ avdmanager
ให้ใช้ไวยากรณ์ต่อไปนี้
avdmanager [global options] command [command options]
ตัวเลือกโดยรวม
ตาราง 1 รายการตัวเลือกทั่วโลกสำหรับ
avdmanager
ตัวเลือกโดยรวม
|
คำอธิบาย
|
-s | --silent
|
โหมดปิดเสียง: พิมพ์เฉพาะข้อผิดพลาด
|
-h | --help
|
ความช่วยเหลือในการใช้งาน
|
-v | --verbose
|
โหมดรายละเอียด: พิมพ์ข้อผิดพลาด คำเตือน และข้อความข้อมูล
|
--clear cache
|
ล้างแคชไฟล์ Manifest ของที่เก็บ SDK Manager
|
คำสั่งและตัวเลือกคำสั่ง
ตาราง 2 รายการคำสั่งและตัวเลือก
สำหรับ Avdmanager
คำสั่งและตัวเลือก
|
คำอธิบาย
|
create avd -n name -k "sdk_id" [-c
{path|size}] [-f] [-p path]
|
สร้าง AVD ใหม่ คุณต้องระบุ name สำหรับ AVD และ
ระบุรหัสของแพ็กเกจ SDK ที่จะใช้สำหรับ AVD โดยใช้
sdk_id รวมอยู่ในเครื่องหมายคำพูด
ตัวอย่างเช่น คำสั่งต่อไปนี้สร้าง AVD ชื่อ test
ใช้อิมเมจระบบ x86 สำหรับ API ระดับ 25:
avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"
ต่อไปนี้เป็นคำอธิบายการใช้งานสำหรับตัวเลือกอื่นๆ
-
-c {path|size} : เส้นทางสู่ SD
ภาพการ์ดสำหรับ AVD นี้หรือขนาดของรูปภาพการ์ด SD ใหม่ที่จะสร้าง
สำหรับ AVD นี้ในหน่วย KB หรือ MB จะแสดงด้วย 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 แสดงรายการทั้ง 3 รายการ รวม -c
เพื่อรับเอาต์พุตแบบกะทัดรัดที่เหมาะสำหรับสคริปต์
อาร์กิวเมนต์ -c ไม่พร้อมใช้งานเมื่อแสดงรายการตัวเลือกทั้ง 3 รายการ
|
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 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-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. |"]]