[[["容易理解","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 (世界標準時間)。"],[],[],null,["# Use Android Emulator virtual devices\n\nYou can use Android Emulator to create emulations of Android devices\nthat run your own custom Android system images. In\naddition, you can add multi-display support to Android Emulator\nemulations.\n\nAndroid Emulator architecture\n-----------------------------\n\nAndroid Emulator runs the Android operating\nsystem in a virtual machine called an Android Virtual Device (AVD). Each AVD\ncontains the full\n[Android software stack](/docs/core/architecture), and it runs as if it\nwere on a physical device. Figure 1 illustrates Android Emulator's\nhigh-level architecture. For more information about the emulator, see\n[Run apps on the Android Emulator](https://developer.android.com/studio/run/emulator).\n\n**Figure 1.** Android Emulator architecture.\n\nBuild AVD images\n----------------\n\nEach AVD includes an Android system image, which runs in\nthat AVD. The AVD Manager includes some system images. And you can build custom\nAVD system images from your source code and create device emulations to run\nthem.\n| **Note:** You need to [establish a build environment](/docs/setup/start/initializing) before building AVD system images.\n\nTo build and run an AVD system image:\n\n1. Download the Android source:\n\n mkdir aosp-android-latest-release; cd aosp-android-latest-release\n repo init -u\n repo sync -j24\n\nIf you want to build other Android versions, you can find their branch names in\nthe [public Android repository](https://android.googlesource.com/platform/manifest/+refs).\nThey map to\n[Android Codenames, Tags, and Build Numbers](/docs/setup/reference/build-numbers#source-code-tags-and-builds).\n\n1. Build an AVD system image. This is the same process as [building an\n Android](/docs/setup/build/building) device system\n image. For example, to build a x86 64-bit AVD:\n\n source ./build/envsetup.sh\n lunch sdk_phone_x86_64\n make -j32\n\n2. Run the AVD system image in the Android Emulator:\n\n emulator\n\nSee\n[Command-line startup options](https://developer.android.com/studio/run/emulator-commandline#startup-options)\nfor more details about running the emulator. Figure 2 shows an example of the\nAndroid Emulator running an AVD:\n\n**Figure 2.** Android Emulator running an AVD.\n\nShare AVD system images for others to use with Android Studio\n-------------------------------------------------------------\n\nFollow these instructions to share your AVD system images with others. They can\nuse your AVD system images with [Android\nStudio](https://developer.android.com/studio) to develop and test apps.\n\n1. Make additional `sdk` and `sdk_repo` packages:\n\n For Android 13 and higher, use the `emu_img_zip`\n command: \n\n $ make emu_img_zip\n\n This generates an `sdk-repo-linux-system-images-eng.[username]].zip` file.\n\n For Android 12 and lower, use the `sdk_repo`\n command: \n\n $ make -j32 sdk sdk_repo\n\n The `make sdk sdk_repo` command creates two files under\n `aosp-android-latest-release/out/host/linux-x86/sdk/sdk_phone_x86`:\n - `sdk-repo-linux-system-images-eng.[username].zip`\n - `repo-sys-img.xml`\n2. Host the file `sdk-repo-linux-system-images-eng.[username].zip`\n somewhere accessible to your users, and get its URL to use as the **AVD\n System Image URL**.\n\n3. For Android 12 and lower, edit `repo-sys-img.xml` accordingly:\n\n - Update `\u003csdk:url\u003e` to your **AVD System Image URL**.\n - See [sdk-sys-img-03.xsd](https://android.googlesource.com/platform/prebuilts/devtools/+/refs/heads/android16-release/repository/sdk-sys-img-03.xsd) to learn about other updates to the file.\n - Host `repo-sys-img.xml` somewhere accessible to your users, and get its URL to use as the **Custom Update Site URL**.\n\nTo use a custom AVD image, do the following in the SDK Manager:\n\n1. Add the **Custom Update Site URL** as an\n [SDK Update Site](https://developer.android.com/studio/intro/update#adding-sites).\n\n This adds your custom AVD system image to the System Images page.\n2. [Create an AVD](https://developer.android.com/studio/run/managing-avds#createavd)\n by downloading and selecting the custom AVD system image.\n\nAdd multi-display support\n-------------------------\n\nAndroid 10\n[enhances multi-display](/docs/core/display/multi_display)\nto better support more use cases, such as auto and desktop mode. Android\nEmulator also supports multi-display emulation. So you can create a specific\nmulti-display environment without setting up the real hardware.\n\nYou can add multi-display support to an AVD by making the following changes, or\nby cherry picking from\n[these CLs](https://android-review.googlesource.com/q/topic:%22AVD+Multi-display%22+(status:open%20OR%20status:merged)).\n\n- Add the multi-display provider to the build by adding these lines to file\n `build/target/product/sdk_phone_x86.mk`:\n\n PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST := \\\n system/lib/libemulator_multidisplay_jni.so \\\n system/lib64/libemulator_multidisplay_jni.so \\\n system/priv-app/MultiDisplayProvider/MultiDisplayProvider.apk \\\n PRODUCT_PACKAGES += MultiDisplayProvider\n\n- Enable the Multi-Display feature flag by adding this line to file\n `device/generic/goldfish/data/etc/advancedFeatures.ini`:\n\n MultiDisplay = on\n\nYou can find the latest emulator features and release information from\nthe following sources:\n\n- [Run apps on Android Emulator](https://developer.android.com/studio/run/emulator)\n- [Android Emulator release notes](https://developer.android.com/studio/releases/emulator)"]]