Stops debugging with error: "Could not debug. error: more than one device/emulator"
Using one device through tcpip
React Native version: 0.35
Output of the Debug Console (View -> Toggle Debug Console):
BUILD SUCCESSFUL
Total time: 21.414 secs
Starting the app on 192.168.1.168:5555 (C:UsersRichardAppDataLocalAndroidsdk/platform-tools/adb -s 192.168.1.168:5555 shell am start -n com.manager/.MainActivity)...
Starting: Intent { cmp=com.manager/.MainActivity }
[vscode-react-native] Finished executing: react-native.cmd run-android
[Error] "Could not debug. error: more than one device/emulator"
Works fine with Genymotion simulator.
Could you please open a command line and run adb devices and show the response you get?
C:UsersRichard>adb devices
List of devices attached
192.168.1.168:5555 device
Also works fine with the device attached.
Could you please clarify the scenario where it doesn't work? When you have a network attached device, but not with a network attached emulator or with a physically attached device?
No issues with a simulator on the same machine and a physically attached device.
It only has an issue when my device is connected through tcpip.
Don't know if it's related but, from time to time after launching VScode, I see an error message in the output: "Failed to setup the stub launcher for the debugger". It doesn't show up every time.
I can replicate your error but only if adb devices shows up multiple targets (e.g. multiple emulator instances).
You should be able to work around this by explicitly specifying the device you want to connect to in launch.json: add a "target": "192.168.8.8:5555", property to the "launch android" entry, where the value is whatever shows up for your device under adb devices.
Still the same error with the "target" property inserted in "Debug Android" task in launch.json. Actually, the phone does not connect at all to the server when I make that change.
Thanks for trying to help but I have a feeling that it's my own private little bug with adb. For some reason, only part of the Debug console output could be pasted to my description but I now can see an error at the beginning of the build which is:
Running C:\Users\Richard\AppData\Local\Android\sdk/platform-tools/adb -s 192.168.1.168:5555 reverse tcp:8081 tcp:8081
error: more than one device/emulator
Could not run adb reverse: Command failed: C:\Users\Richard\AppData\Local\Android\sdk/platform-tools/adb -s 192.168.1.168:5555 reverse tcp:8081 tcp:8081
trying the "adb -s 192.168.1.168:5555 reverse tcp:8081 tcp:8081" command in a Command Prompt gives the same "error: more than one device/emulator"
Exact same problem here. Running adb -s 192.168.0.100:5555 reverse tcp:8081 tcp:8081 always gives "error: more than one device/emulator".
@gmaliandi, still the same for me. I thought it had to do with Genymotion because of VirtualBox but that wasn't it. Does it have to do with Samsung's driver since I'm using a Note 4? I'm waiting for my pixel to know for sure.
Same error here if I try to run on a device without cable:
cd C:\Users\Daniel\AppData\Local\Android\sdk\platform-tools
adb tcpip 5555 && adb connect 192.168.1.129:5555
react-native start
react-native run-android
Could not get BatchedBridge, make sure your bundle is packaged correctly.
[Error : 0104] Failed to run the application in Android: error: more than one device/emulator
adb devices
List of devices attached
192.168.1.129:5555 device
@DFelten, if you want to debug over wi-fi, make sure that you have specified your debug host IP and port in app's Developer menu -> Dev settings -> Debug server host & port
@gmaliandi, @Ruzo, were you guys trying to debug app that was connected through network, rather than cable?
Thanks, after defining the IP and my port it's working :)
@vladimir-kotikov yes, through network with host IP and port entered in Dev settings. It worked before, not sure what happened. Did not try it since though.
Hi @careergod
Please see this issue in react-native repo.
Seems like there is some problems with android adb
Are there any other solutions?! I have tried everything above and nothing helps. I have stuck there for 4 days.
@DFelten, if you want to debug over wi-fi, make sure that you have specified your debug host IP and port in app's Developer menu -> Dev settings -> Debug server host & port
@vladimir-kotikov How to do this for Android TV?
Dev Menu support: On the simulator, cmd-M will bring up the developer menu, just like on Android. To bring it up on a real Android TV device, press the menu button or long press the fast-forward button on the remote. (Please do not shake the Android TV device, that will not work :) )
See here: https://facebook.github.io/react-native/docs/building-for-apple-tv
If there is an emulator stuck on "connecting" when you do adb devices then that means there is a program running within the adb port range. (emulator-5562 for me running on 5562 was stuck on "connecting").
I discovered that the Native Instruments Access program which I installed, runs NTKDaemon on my computer (on port 5562). In order to build and start my app on emulator I have to force close NTKDaemon. On mac os you can open Activity Monitor to kill it, or Control panel on windows.
Hope this helps someone
if you have this Error
Couldn't start project on Android: Error running adb: more than one device/emulator
this means you have 2 android devices connected ( your mobile by USB ), COUNTS dISCONNECT and Retry Again
anyone solved this issue? I have same error even there is only on device which is connected over wifi. I have same wifi network connected on the machine as well as device.
It works fine on USB cable but I want to get rid of the cable.
Hi @Sanan4li. I could debug android application remotely over wi-fi using the following steps:
Dev Settings -> Debug server host & port for device on device pointing to IP-address of my dev machine on which packager has been started.Attach to packager configuration.Could you please let us know, if this worked for you?
You can also see related issues: https://github.com/microsoft/vscode-react-native/issues/721, https://github.com/facebook/react-native/issues/17379
Still the same error with the "target" property inserted in "Debug Android" task in launch.json. Actually, the phone does not connect at all to the server when I make that change.
Thanks for trying to help but I have a feeling that it's my own private little bug with adb. For some reason, only part of the Debug console output could be pasted to my description but I now can see an error at the beginning of the build which is:
Running C:\Users\Richard\AppData\Local\Android\sdk/platform-tools/adb -s 192.168.1.168:5555 reverse tcp:8081 tcp:8081 error: more than one device/emulator Could not run adb reverse: Command failed: C:\Users\Richard\AppData\Local\Android\sdk/platform-tools/adb -s 192.168.1.168:5555 reverse tcp:8081 tcp:8081trying the "adb -s 192.168.1.168:5555 reverse tcp:8081 tcp:8081" command in a Command Prompt gives the same "error: more than one device/emulator"
It is not your private little bug. I'm getting the same error here. My adb devices also outputs a single connected device, when connected via tcpip:
List of devices attached
192.168.0.71:5555 device
Most helpful comment
Exact same problem here. Running
adb -s 192.168.0.100:5555 reverse tcp:8081 tcp:8081always gives"error: more than one device/emulator".