Note: You can find a quick summary at the end of the page.
In the world of Android development, Android Debug Bridge (ADB) is an essential tool that enables developers to communicate with Android devices. While USB connections are common for development, connecting via Wi-Fi can enhance your workflow and flexibility. In this blog post, we’ll explore how to use the adb tcpip 5555
command to set up ADB over Wi-Fi.
What is ADB?
ADB (Android Debug Bridge) is a command-line tool that facilitates communication between your computer and an Android device. It allows you to execute commands, install and uninstall apps, debug applications, and perform various actions directly from your computer.
Why Connect Over Wi-Fi?
Connecting your Android device over Wi-Fi can be advantageous for several reasons:
- Freedom of Movement: No need to be tethered to your computer with a USB cable.
- Convenience: You can run tests and commands without physically connecting and disconnecting the device.
- Multiple Devices: Easily manage multiple devices without switching cables.
Prerequisites
Before you begin, ensure you have the following:
- An Android device with USB debugging enabled.
- A computer with ADB installed. You can download the Android SDK Platform Tools for this.
- Both your computer and Android device connected to the same Wi-Fi network.
Step-by-Step Guide
Step 1: Connect Your Device via USB
Start by connecting your Android device to your computer using a USB cable. This step is essential for the initial setup.
Step 2: Open Your Command Line
Open a terminal or command prompt on your computer. This is where you will enter ADB commands.
Step 3: Switch ADB to Wi-Fi Mode
Enter the following command to switch ADB from USB to Wi-Fi mode:
adb tcpip 5555
What it does: This command tells ADB to start listening for connections on port 5555 over Wi-Fi.
Step 4: Find Your Device’s IP Address
Next, you need to find the IP address of your Android device. You can do this by running:
adb shell ip route
The IP address is shown after src
. It will look something like 192.168.x.x
.
Alternatively, you can find the IP address in your device’s Wi-Fi settings.
Step 5: Connect Over Wi-Fi
Now, use the IP address you obtained to connect to your device over Wi-Fi. Replace <device-ip> with your actual device’s IP address :
adb connect <device-ip>:5555
Step 6: Verify the Connection
To confirm that your device is connected, run:
adb devices
You should see your device listed with its IP address. If it appears, congratulations!
You have successfully connected your Android device to ADB over Wi-Fi.
Summary
adb devices
: Check that the phone is connected.adb tcpip 5555
: Switch ADB to Wi-Fi mode.adb shell ip route
: (Optional) Get your phone’s IP address.adb connect <device-ip>:5555
: Connect to your phone over Wi-Fi.