Skip to main content

How to set up and use ADB over Wi-Fi

Android Debug Bridge (ADB) is a versatile tool that allows developers to communicate with Android devices for debugging and other tasks. Traditionally, ADB connections require a USB cable, but it's possible to establish a connection over Wi-Fi, offering greater flexibility. This guide provides step-by-step instructions to set up ADB over Wi-Fi and outlines common issues you might encounter.


Prerequisites

  • Android Device: Ensure your device is running Android 11 or later.Toxigon
  • Computer: A PC with ADB installed. You can download the latest version of the Android SDK Platform Tools from the official Android developer website.
  • USB Cable: Required for the initial setup.
  • Wi-Fi Network: Both your Android device and computer must be connected to the same Wi-Fi network.

Steps to set up ADB over Wi-Fi

  1. Enable Developer Options on Your Android Device:

    • Navigate to Settings > About phone.
    • Tap on Build number seven times until you see a message confirming that Developer Options are enabled.
  2. Enable USB Debugging:

    • Go back to Settings > System > Developer options.
    • Scroll down and toggle on USB debugging.
  3. Connect Your Android Device to Your Computer via USB:

    • Use a USB cable to connect your device to the computer.
  4. Verify ADB Connection:

    • Open a command prompt or terminal on your computer.
    • Enter:  
                       adb devices
                    
                    Ensure your device appears in the list of connected devices.

      5. Enable ADB Over Wi-Fi:
    • In the command prompt or terminal, type: 

                       adb tcpip 5555


                    This command restarts the ADB daemon to listen on port 5555. Stack Overflow

       6. Find your device's IP address:
    1. On your Android device, go to Settings > About phone > Status.
    2. Note the IP address listed. 
        7. Connect to your device over Wi-Fi:
                
                In the command prompt or terminal, 
                Type: 

                           adb connect [Your Device's IP Address]:5555  


                Replace [Your Device's IP Address] with the actual IP address you noted earlier. 

        8. Disconnect the USB cable:
                
                Once connected over Wi-Fi, you can unplug the USB cable.

        9. Verify the Wireless Connection:

    • Type: adb devices

                    Your device should now appear as connected over Wi-Fi.


Common Issues and Troubleshooting

  • Initial USB Connection Requirement: The first-time setup requires a USB connection to authorize the computer. Subsequent connections can be made over Wi-Fi without a USB cable. AirDroid

  • Same Network Requirement: Ensure both your Android device and computer are on the same Wi-Fi network. ADB over Wi-Fi won't work across different networks or subnets.

  • ADB Over Wi-Fi Turning Off Automatically: Some devices may disable ADB over Wi-Fi after a reboot or network change. If this happens, repeat the setup process starting from the USB connection.

  • Connection Refused Error: If you encounter a "connection refused" error:

    • Verify the IP address of your device.
    • Ensure no firewall is blocking the connection.
    • Restart the ADB server by typing:
      • adb kill-server
      • adb start-server
  • Security Considerations: Using ADB over Wi-Fi can pose security risks, especially on public networks. Ensure you're on a trusted network and disable ADB over Wi-Fi when not in use.

By following these steps and being aware of the common issues, you can effectively set up and use ADB over Wi-Fi for a more flexible development experience.

Comments

Popular posts from this blog

How to find firmware or boot ROM version in Mac OS X

Firmware and boot ROM version of your mac can be found in two ways. Way 1 : 1. From "Apple" menu , choose "About This Mac" menu item. 2. Click " More Info " to open "System Profiler" application. 3. Under Contents -> Select Hardware Tree item. On the right side panel Under hardware overview section, we can see Boot ROM Version and SMC (Firmware) Version. Way 2 : Run the below command in terminal to get boot ROM version and SMC(firmware) version : $ system_profiler SPHardwareDataType | grep -i "Version" | awk -F ':' '{print $1 $2}'

How to disable USB ports on Mac OS X Mavericks, Yosemite or El Capitan ?

We might wonder how to disable the USB ports on Mac to prevent data copy to external USB mass storage devices. The USB kext on os x is loaded at the time of start of the system, this can be loaded / unloaded using kextload or kextunload command. To disable USB port on Mac , follow below steps: On Macs running  Mountain Lion, Mavericks  and Yosemite : Unmount any connected USB devices to the system by running below command                  $ diskutil unmount /Volumes/USBDISK. Now unload the USB related kernel extensions in the following order using kextunload command.             sudo kextunload -b com.apple.driver.AppleUSBCardReader             sudo kextunload -b com.apple.driver.AppleUSBODD             sudo kextunload -b com.apple.iokit.IOUSBMassStorageClass        This wil...

What are the useful nvram settings in macOS ?

The OS X boot arguments are useful for troubleshooting problems with system startup and how the system behaves when running. sudo nvram boot-args="-v" :  This command will set the system to always boot to verbose mode, so we do not need to hold Command + V at system startup. sudo nvram boot-args="-x" :  This will set the system to always boot into Safe Mode. sudo nvram boot-args="-s" :  This command will boot the system into single user mode without needing to hold Command-S at system startup. sudo nvram boot-args="iog=0x0"  :   when you close the display but connect the system to an external monitor and keyboard the system will stay awake. After running this command, when connecting an external monitor, the internal display will be disabled, which can be beneficial in some situations such as those where you are mirroring your desktop but wish to run the external display at a higher resolution than your laptop can run. sudo nvram b...