How to connect multiple android devices with ADB over wifi

后端 未结 3 1372
野性不改
野性不改 2021-02-05 21:58

ADB is installed in the computer, and usb debugging is enabled on devices. Also I have connected one device over wifi successfully. How to connect more devices without having to

相关标签:
3条回答
  • 2021-02-05 22:55

    Yes there is a way to do so without having to type the serial number.

    Say you have 2 devices A (IP: 192.168.1.32) and B (IP: 192.168.1.33) that you want to connect to ADB over wifi:

    1. Connect device A with a USB cable to the computer (but not B)
    2. adb -d tcpip 5555
    3. adb connect 192.168.1.32
    4. Disconnect device A, and connect device B with a USB cable to the computer
    5. adb -d tcpip 5555
    6. adb connect 192.168.1.33
    0 讨论(0)
  • 2021-02-05 22:55

    A slight change in the Abdul Wasae answer, based on my experience .

    devices A (IP: 192.168.1.32)

    devices B (IP: 192.168.1.33)

    Connect device A with a USB cable to the computer (but not B)

    adb -d tcpip 5555

    adb connect 192.168.1.32

    Disconnect device A, and connect device B with a USB cable to the computer,This time you need to change the port !!

    adb -d tcpip 5554
    

    Here you need to specify port as well

    adb connect 192.168.1.33:5554
    

    I also have documented this here in more detail Connecting multiple devices over wifi using adb

    0 讨论(0)
  • 2021-02-05 23:02

    I have this problem long time ago so I decided to create this simple bash script.

    Assuming that you already added the adb to the path:

    export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
    

    You just need to follow this steps:

    1. Run this commands: to create your script (typically, you want $HOME/bin for storing your own scripts)

      cd ~
      mkdir bin
      cd bin
      touch adb_connect
      
    2. Open and copy the script using any editor like gedit.

      gedit adb_connect
      
    3. And make your file executable.

      sudo chmod +x adb_connect
      
    4. Modify your path to add the directory where your script is located:

      export PATH=$PATH:$HOME/bin
      
    5. Finally, now connect your device using USB and run the script:

      adb_connect
      
    6. Your device must be connect now, disconnect the USB cable and repeat steps 5 and 6 to add more devices. If a successful connection occurs, it will have this output:

      Connecting to LGV498bdcb2c5
      restarting in TCP mode port: 7105
      connected to 192.168.20.105:7105
      
    0 讨论(0)
提交回复
热议问题