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 extract signing certificates from macOS binary files

Code signing is a macOS security technology that you use to certify that an app was created by you. Once an app is signed, the system can detect any change to the app—whether the change is introduced accidentally or by malicious code. As Apple Developer site says ( click here for more details  on code signing) : code signing allows the operating system to: Ensure that a piece of code has not been altered since it was signed.  The system can detect even the smallest change, whether it was intentional (by a malicious attacker, for example) or accidental (as when a file gets corrupted). When a code signature is intact, the system can be sure the code is as the signer intended. Identify code as coming from a specific source (a developer or signer).  The code signature includes cryptographic information that unambiguously points to a particular author. Determine whether code is trustworthy for a specific purpose.  Among other things, a developer can use a ...

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 enable root login in gnome on Debian 6 or 7

Root user login in gnome is disabled on Debian system by default for security reasons. If you want to enable it for specific reasons then follow the below steps : 1. Login into Debian system 2. launch the Root Terminal from Applications -> Accessories. 3. Authenticate with password to launch the Root Terminal. 4. Open "/etc/pam.d/gdm3" with vi.          #vi /etc/pam.d/gdm3 5. Look for "auth     required     pam_succeed_if.so  user  != root   quiet_success"  , comment it out as below.     #auth     required     pam_succeed_if.so  user  != root   quiet_success 6. Save the modification with Esc+w+q+Enter keystroke. 7. Restart or reboot Debian system. 8. Login with root user in gnome. You should be now able to login successfully.