question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot connect to dev server and Always detect more than one device

See original GitHub issue

Is this a bug report?

yes

Have you read the Contributing Guidelines?

yes

Environment

OS: Windows 10 Node: 8.9.3 Yarn: 1.3.2 npm: 5.5.1 Watchman: Not Found Xcode: N/A Android Studio: Not Found

Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.51.0 => 0.51.0

Target Platform: Android (5.0)

Steps to Reproduce

  1. Run adb connect (ADB Over Network)
adb connect 192.168.137.116:8081
connected to 192.168.137.116:8081
  1. Run adb devices
adb devices
List of devices attached
192.168.137.116:8081    device
  1. Run project
react-native run-android
Scanning folders for symlinks in c:\404\TuneApp\node_modules (172ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee130Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore130Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp3130Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0510Library UP-TO-DATE
:app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug
:app:packageDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:installDebug
Installing APK 'app-debug.apk' on 'G36C1H - 5.0.2' for app:debug
Installed on 1 device.

BUILD SUCCESSFUL

Total time: 1 mins 37.678 secs
Running C:\APPS\Android\SDK/platform-tools/adb -s 192.168.137.116:8081 reverse tcp:8081 tcp:8081
error: more than one device and emulator
Could not run adb reverse: Command failed: C:\APPS\Android\SDK/platform-tools/adb -s 192.168.137.116:8081 reverse tcp:8081 tcp:8081
Starting the app on 192.168.137.116:8081 (C:\APPS\Android\SDK/platform-tools/adb -s 192.168.137.116:8081 shell am start -n com.tuneapp/com.tuneapp.MainActivity)...
Starting: Intent { cmp=com.tuneapp/.MainActivity }
  1. Run adb reverse
adb reverse tcp:8081 tcp:8081
error: more than one device and emulator

if i check adb devices again still show like no. 2

  1. Check ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::7dfb:1473:2b83:20b3%13
   IPv4 Address. . . . . . . . . . . : 192.168.1.111
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.254

Wireless LAN adapter Local Area Connection* 13:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::953f:e8d:2621:fb78%5
   IPv4 Address. . . . . . . . . . . : 192.168.137.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:0:9d38:90d7:148c:1edc:825e:7cb0
   Link-local IPv6 Address . . . . . : fe80::148c:1edc:825e:7cb0%3
   Default Gateway . . . . . . . . . : ::
  1. Shake phone and go to dev settings
Debug server host & port for device
192.168.1.111:8081
  1. Shake my phone and reload js
Could not connect to development server

Note: after creating new project i not change anything of code.

Expected Behavior

I think after run react-native run-android my project is running to my device, but i get error like adb reverse detect more than one device and emulator and cannot connect to development server.

Actual Behavior

  1. Error : cloud not connect to development server
  2. Error : always detect more than one device and emulator image

Reproducible Demo

I don’t change anything in the code, after creating new project i run that project with react-native start and react-native run-android. but, if you want to see the original source code please follow this repository tuneapp

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Grohdencommented, Jan 16, 2018

@sgnd solved MY problem by this comment

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

I didn’t knew where the Developer menu was, took me some time to figure out that i should violently shake my phone with the app open to find this menu.

Once i had configured the debug server+port, closed my app, restarted the react-native run-android everything started to work again.

BTW: ADB error still persists (tested in two windows machines), it could be related to android custom ROMs (?)

0reactions
sgndcommented, Jan 16, 2018

@Grohden yes, i think because custom rom. But i try that still not working.

Now, i use expo for development and testing. Easy settings for beginner like me. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can only connect to Dev server from 2 devices
I have a beta demo for a client to check but I can't see the host list for my dev server from any...
Read more >
Could not connect to React Native development server on ...
What solved the problem for me was to open up android studio, go into AVD manager, actions > Stop and then Cold Boot...
Read more >
Device Manager does not display devices that are not ...
Devices that you install that are not connected to the computer are not displayed in Device Manager, even when you click Show hidden...
Read more >
Remote Development Tips and Tricks - Visual Studio Code
Check to see if you already have an SSH key on your local machine. ... such as "Could not establish connection to server_name...
Read more >
How To Fix the “Server IP Address Could Not Be Found” Error
However, there are fewer errors more clear than the “Server IP address ... process couldn't find an IP address for a specific domain...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found