React Native adb reverse error: more than one device

17,675

Solution 1

When I am facing the same issues than doing like below:

  • Restart adb by issuing adb kill-server followed by adb start-server in a command prompt.
  • Disable and re-enable USB debugging on the phone Rebooting the phone if it still doesn't work.

my issues have been resolved with these steps.

Solution 2

When I am facing the same issues than doing like below:

1) kill your process of 8081 port for using this command : kill -9 $(lsof -t -i:8081)

2) Reset your adb connection with : adb usb if you want to run via wifi then connect your device again : adb tcpip 5555

3) Start your npm : npm start

4) Then after you can run your react native app : react-native run-android

and it's works fine for me.

Solution 3

Task Manager

Open Task Manager > search "qemu" > kill it. I using Android emulator, work for me! Good luck :)

Share:
17,675
subtleseeker
Author by

subtleseeker

Updated on June 27, 2022

Comments

  • subtleseeker
    subtleseeker almost 2 years

    I am learning react native. I can successfully connect my android device using USB. But when I try to connect it using wifi, it gives me an error.

    $ adb kill-server      
    $ adb version
    Android Debug Bridge version 1.0.40
    Version 4986621
    Installed as /home/subtleseeker/Android/Sdk/platform-tools/adb          
    $ adb connect 172.26.40.211:8081
    
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    connected to 172.26.40.211:8081
    $ adb devices                   
    List of devices attached
    172.26.40.211:8081      device
    
    $ react-native run-android
    JS server already running.
    Building and installing the app on the device (cd android && ./gradlew installDebug)...
    Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
    cache results.bin (/home/subtleseeker/.gradle/caches/transforms-1/metadata-1.1/results.bin) is corrupt. Discarding.
    
    > Task :app:installDebug 
    Installing APK 'app-debug.apk' on 'POCO F1 - 8.1.0' for app:debug
    Installed on 1 device.
    
    BUILD SUCCESSFUL in 31s
    27 actionable tasks: 1 executed, 26 up-to-date
    Running /home/subtleseeker/Android/Sdk/platform-tools/adb -s 172.26.40.211:8081 reverse tcp:8081 tcp:8081
    error: more than one device/emulator
    Could not run adb reverse: Command failed: /home/subtleseeker/Android/Sdk/platform-tools/adb -s 172.26.40.211:8081 reverse tcp:8081 tcp:8081
    Starting the app on 172.26.40.211:8081 (/home/subtleseeker/Android/Sdk/platform-tools/adb -s 172.26.40.211:8081 shell am start -n com.awe4/com.awe4.MainActivity)...
    Starting: Intent { cmp=com.awe4/.MainActivity }
    

    In the Dev settings of the app, I have configured Debug server host & port for device to the ip address of my computer as 172.26.43.71:8081. Also it is clear from the output, that the connection was successful and the apk is installed.

    I can't see how to resolve this error: error: more than one device/emulator. Any help is appreciated.
    NOTE: This question may be a duplicate of this, but it doesn't have any answers.

  • Arnold Schrijver
    Arnold Schrijver almost 5 years
    This did not work. Issue remains as described in the question, after these steps.
  • Brijesh Goswami
    Brijesh Goswami almost 5 years
    Then you need to R&D on port because it is a port-related issue so you need to release one port before using another.