React Native运行Android模拟器报错:未找到Android设备求助
I'm new to React Native and successfully ran my first Hello World app on a physical device using Expo. Now I want to run it on an Android emulator. I created an AVD running Marshmallow via Android Studio's AVD Manager, but every time I run react-native run-android, I get this error:
Error running adb: No Android device found. Please connect a device and follow the instructions here to enable USB debugging:
Here's the full run log:
mike@mike-Laptop:~/Desktop/react-native/AwesomeProject$ react-native run-android Scanning folders for symlinks in /home/mike/Desktop/react-native/AwesomeProject/node_modules (8ms) 03:39:59: Starting packager... 03:44:13: Starting Android... 03:44:18: Packager started! To view your app with live reloading, point the Expo app to this QR code. You'll find the QR scanner on the Projects tab of the app. EDIT This is the SS.... And I get the below error .... mike@mike-Laptop:~/Desktop/react-native/AwesomeProject$ react-native run-android Scanning folders for symlinks in /home/mike/Desktop/react-native/AwesomeProject/node_modules (116ms) 21:59:10: Starting packager... 22:03:47: Starting Android... 22:07:47: Packager started! To view your app with live reloading, point the Expo app to this QR code. You'll find the QR scanner on the Projects tab of the app. Or enter this address in the Expo app's search bar: exp://192.168.1.35:19000 Your phone will need to be on the same local network as this computer. For links to install the Expo app, please visit https://expo.io. Logs from serving your app will appear here. Press Ctrl+C at any time to stop. Error running adb: No Android device found. Please connect a device and follow the instructions here to enable USB debugging:
I'd really appreciate any troubleshooting tips to get this working!
Hey there, let's work through this step by step—this is a super common hiccup when switching from physical devices to emulators with Expo/React Native. Here are the key fixes to try:
1. Confirm your emulator is actually running first
This sounds obvious, but double-check that your Marshmallow AVD is up and running in Android Studio. A lot of folks forget to launch the emulator before running the react-native run-android command.
2. Verify ADB can detect your emulator
Open a terminal and run adb devices—this should list your running emulator. If it doesn't show up:
- Restart the ADB server with
adb kill-serverfollowed byadb start-server - If that still doesn't work, close and reopen the emulator, then re-run
adb devices
3. Fix your environment variables (Linux-specific)
Since you're on Ubuntu (from your terminal username), make sure the Android SDK platform tools are in your system PATH:
- Open your
~/.bashrcor~/.zshrcfile (depending on which shell you use) - Add this line (adjust the path to match where your Android SDK is installed—usually
~/Android/Sdk/platform-tools):export PATH=$PATH:~/Android/Sdk/platform-tools - Save the file, then run
source ~/.bashrc(orsource ~/.zshrc) to apply the changes - Now run
adb devicesagain to confirm it's working
4. Use Expo's dedicated command instead of react-native run-android
Wait a second—since you're using Expo, you might be mixing up commands! Expo projects are designed to be run with expo start instead of the vanilla React Native command. Here's what to do:
- Stop any running packagers or emulators
- Run
expo startin your project directory - Once the Expo dev tools open in your browser, click the "Run on Android device/emulator" button—this should automatically detect your running emulator, install the Expo client on it, and load your app
5. Double-check emulator settings
- Make sure your emulator has USB debugging enabled (yes, even emulators need this!)
- Open the emulator, go to Settings > About Phone > Tap "Build Number" 7 times to unlock Developer Options
- Go back to Settings > Developer Options > Enable "USB Debugging"
- Also, confirm the emulator is connected to the same local network as your computer (Expo relies on this for connectivity)
Try these steps in order—chances are either the ADB connection or using the wrong command is the root issue. Let me know if any of these fix it!
内容的提问来源于stack exchange,提问作者Mike IT

