more than one device/emulator react native Error in react native start

Viewed 12228

I start my Genymotion then i do npm start on my react native project via VS Code . i got this message:

>Press a to open android device or Emulator
>Press q to display QrCode
 .
 .

so i pressed a but i got this error:

Error running adb: more than one device/emulator

how can i solve this? i tried adb devices to see my devices and i saw this list:

emulator-5562 host
emulator-5560 host
emulator-5558 host
192.168.X.X device

my OS is windows 10. i couldn't even start my react native hellow-world still

Edit: i turned of my system and in next day every thing worked on . why? i checked devices again by this command: adb devices this time the list includes just one device : 192.168.X.X device so we have to have only one device as emulator but!! how can i kill all devices just one in adb?

8 Answers

This happened to me although I had just one Genymotion emulator running. The problem was I was charging my phone with my laptop, and I had USB debugging enabled. Disabling USB debugging in my phone fixed the problem.

Open your task manager and in the background processes finalize the adb process.

Same error with Expo XDE for React Native apps.
Trying to deploy on test device while charging phone.
Solution: disabled debug usb on second phone solved the problem (as error log suggested)

In case somebody stumbles upon this question.. you can also use
react-native run-android --deviceId=<deviceId where you want to run your app>

If you are not sure what to do, then:

  1. Disconnect any phone which might be connected to your computer.

  2. Close all the Apps and restart your computer.

  3. After restart open just one emulator from android studio. If running on real device, connect just one device (and close the emulator).

The error is showing because bundler is detecting more than one device/emulator which are connected via ADB.

** Scan QR Code to run your app on multiple devices at the same time.

Open TaskManager search for adb.exe and close it go back to your console press a again and it will work

exp

If you're having trouble stopping individual emulators, adb kill-server quite reliably stops all emulators.

Related