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

求助:执行npx react-native run-android时提示未找到模拟器,但PowerShell中可检测到运行中的AVD

Troubleshooting "No emulators found" in React Native run-android (when emulator -list-avds works)

Hey there! It’s super frustrating when your emulator shows up in emulator -list-avds but React Native can’t seem to detect it. Let’s walk through the most common fixes to get your app running on the emulator:

  • Check environment variable consistency across terminals
    The terminal you’re using for React Native might not have the same environment variables as the PowerShell window where emulator -list-avds works. Make sure ANDROID_SDK_ROOT is set as a system environment variable (not just a user variable), and that %ANDROID_SDK_ROOT%\emulator is added to your Path variable. After verifying, close all open terminals and restart them—this ensures the updated variables take effect.

  • Verify your emulator is recognized by adb
    Even if the emulator is running, it might not be connected to the Android Debug Bridge (adb). Run adb devices in your PowerShell; if your emulator doesn’t show up here, reset adb with these commands:

    adb kill-server
    adb start-server
    

    Check adb devices again—once your emulator appears in the list, try npx react-native run-android again.

  • Manually specify the Android SDK path for React Native
    Sometimes React Native doesn’t pick up the SDK path automatically. Try running the command with the SDK root explicitly defined:

    npx react-native run-android --android-sdk-root="C:\Users\YourUsername\AppData\Local\Android\Sdk"
    

    Replace the path with your actual Android SDK location (you can find this in Android Studio’s SDK Manager under "SDK Location").

  • Avoid special characters/spaces in your AVD name
    If your emulator’s name has spaces or special characters (like "My Awesome Emulator"), React Native might struggle to detect it. Rename your AVD to something simple (e.g., "MyEmulator") via Android Studio’s AVD Manager, then restart the emulator and retry the command.

  • Restart your emulator
    Occasionally emulators can enter a hung state where they’re visible in emulator -list-avds but unresponsive to React Native. Close the emulator completely, launch it again from Android Studio or via emulator -avd YourAVDName, then run the React Native command once it’s fully loaded and ready.

Start with the first two fixes—they resolve most cases of this issue!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.01 00:02:43