You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

运行模拟器提示Unknown AVD name,刚创建的AVD无法识别求解决

Fix: "Unknown AVD name" Error After Creating AVD

Hey there! I’ve dealt with this exact frustrating issue before when setting up AVDs in Android Studio. Let’s break down why this happens and get your emulator running.

Why This Happens

The error Emulator: ERROR: Unknown AVD name [Nexus_5X_API_27] usually means one of these things:

  • The AVD wasn’t actually created successfully (even though Studio said it was)
  • The emulator command can’t find the AVD’s configuration files
  • There’s a tiny spelling/case mismatch between the name you’re using and the actual AVD name
  • Permissions are blocking access to the AVD storage directory

Step-by-Step Fixes

1. Verify the AVD Actually Exists

First, confirm if the AVD is really registered on your system:

  • Open a terminal/command prompt
  • Run this command:
    emulator -list-avds
    

If Nexus_5X_API_27 doesn’t show up in the output, the AVD wasn’t properly created. Skip to fix #2. If it does show up, move to fix #3.

2. Recreate the AVD (Most Common Fix)

Android Studio’s AVD Manager sometimes glitches and shows a "created" status even when the underlying files are missing:

  • Open Android Studio → Tools → AVD Manager
  • Find your Nexus_5X_API_27 entry, click the Delete button (trash icon) to remove it completely
  • Recreate the AVD:
    • Make sure the system image you select is fully downloaded (avoid any entries marked "Download")
    • Wait for the "AVD created successfully" confirmation before closing the manager
  • Run emulator -list-avds again to confirm the name appears

3. Use Exact Name & Path to Launch

If the AVD shows up in the list but still errors out:

  • Copy the exact name from the emulator -list-avds output (even minor case/spelling differences matter!)
  • Launch the emulator with the copied name:
    emulator -avd Nexus_5X_API_27
    
  • If that still fails, specify the SDK system image path directly:
    emulator -avd Nexus_5X_API_27 -sysdir <your-sdk-path>/system-images/android-27/google_apis/x86/
    
    Replace <your-sdk-path> with your actual Android SDK root directory (e.g., ~/Android/Sdk on macOS/Linux, C:\Users\YourName\AppData\Local\Android\Sdk on Windows)

4. Fix Permissions (Linux/macOS Only)

On Unix-based systems, permission issues can block the emulator from reading AVD files:

  • Run this command in terminal to set proper ownership of the Android directory:
    sudo chown -R $USER:$USER ~/.android/
    
  • Try launching the emulator again after running this

5. Check Environment Variables

Ensure the emulator command can locate your SDK:

  • Verify that ANDROID_HOME or ANDROID_SDK_ROOT environment variables are set to your SDK root directory
  • On Windows, add <your-sdk-path>/emulator to your System PATH to make the emulator command accessible anywhere

内容的提问来源于stack exchange,提问作者Zarkron

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:16:37