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

Android Studio终端启动模拟器求助:emulator命令未识别

Fixing "emulator not recognized" and GPU Error for OREO Emulator

Hey there! Let's tackle your problem step by step—first getting the emulator command recognized by your system, then resolving the original GPU error that started this.

1. Fixing "emulator未被识别为命令" (emulator command not found)

This error pops up because your system doesn't know where the Android emulator executable is stored. Here's how to fix it on different operating systems:

For Windows

  • First, find your Android SDK path: Open Android Studio, go to File > Settings > Appearance & Behavior > System Settings > Android SDK—the SDK location is listed at the top of this page.
  • The emulator lives in the emulator folder inside your SDK directory. For example, if your SDK path is C:\Users\YourName\AppData\Local\Android\Sdk, the full emulator path is C:\Users\YourName\AppData\Local\Android\Sdk\emulator.
  • Option 1: Run the command with absolute path (quick fix)
    Open Command Prompt and paste the full path to the emulator executable along with your command:
    C:\Users\YourName\AppData\Local\Android\Sdk\emulator\emulator.exe -avd OREO_Emulator -gpu host
    
  • Option 2: Add emulator to system PATH (permanent fix)
    1. Right-click This PC > Properties > Advanced system settings > Environment Variables.
    2. Under System variables, locate Path, then click Edit.
    3. Click New and paste the full path to the emulator folder (like the example above).
    4. Click OK to save all changes, then restart your Command Prompt for the changes to take effect.

For macOS/Linux

  • Find your SDK path: In Android Studio, go to Android Studio > Preferences > Appearance & Behavior > System Settings > Android SDK (macOS) or File > Settings > ... > Android SDK (Linux).
  • By default, the emulator is in ~/Library/Android/sdk/emulator (macOS) or ~/Android/Sdk/emulator (Linux).
  • Option 1: Run with absolute path (quick fix)
    Open Terminal and run:
    ~/Library/Android/sdk/emulator/emulator -avd OREO_Emulator -gpu host
    
  • Option 2: Add to PATH permanently
    1. Open your shell config file (e.g., .bashrc for Bash, .zshrc for Zsh) using a text editor. For Zsh, run:
      nano ~/.zshrc
      
    2. Add this line at the end (replace the path if your SDK is in a different location):
      export PATH="$PATH:$HOME/Library/Android/sdk/emulator"
      
    3. Save and exit the editor, then run source ~/.zshrc (or your config file) to apply changes right away.

2. Resolving the GPU Error (No Terminal Needed)

If you'd rather avoid terminal commands, you can adjust the emulator's GPU settings directly in Android Studio:

  • Open the AVD Manager (the toolbar icon that looks like a phone with a download arrow).
  • Find your OREO_Emulator, click the Edit (pencil) icon next to it.
  • Scroll down and click Show Advanced Settings.
  • Under the Graphics section, change the option to Host (this is exactly what your terminal command was trying to set).
  • Click Finish, then start the emulator again.

This should get rid of the GPU error without needing to use the terminal.


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.27 07:18:22