DEV Community

Cover image for Wireless Debugging in Android
Dilip Chandar
Dilip Chandar

Posted on

1

Wireless Debugging in Android

An interesting and useful feature in android is wireless debugging. This helps us achieve whatever we can do through USB cable like debugging, catching logs in logcat by unplugging our device once wireless connection is established.

Before we establish a wireless connection, we have to keep our device connected through USB cable. Once developer options are enabled, we will be able to see our device in Android Studio. In this article, steps are covered for Mac OS.

Step 1: Open Terminal and go to platform-tools directory. For example

cd Library/Android/sdk/platform-tools

Step 2: Check if adb command is working by typing

adb devices

Step 3: If Step 2 fails by a message zsh: command not found: adb, type the following in terminal. For example

export ANDROID_HOME=/Users/dilipchandar/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Step 4: After Step 3, entering the command adb devices will show us list of devices like this

List of devices attached
28c95c50 device

Step 5: Now we need to establish TCP IP connection with a port number by typing following command

adb tcpip 5555

Above command will display -> restarting in TCP mode port: 5555

Step 6: Finally we can enter the following command after getting our IP Address from our phone’s WiFi Settings. For example if our IP Address is 192.168.1.4

adb connect 192.168.1.4:5555

Above command will display -> connected to 192.168.1.4:5555

We will see the list of devices like the below

List of devices attached
28c95c50 device
192.168.1.4:5555 device (shows device is connected wirelessly)

After this, we can disconnect USB cable and check Android Studio. We will see the device with IP Address in logcat as shown in screenshot

Please note that wireless connection may have to be reactivated if device goes offline by entering command from Step 6 again. That’s all about wireless debugging. Thanks for reading. Happy coding!!

Let’s connect on LinkedIn https://www.linkedin.com/in/dilip-chandar-97570158?

Sentry mobile image

App store rankings love fast apps - mobile vitals can help you get there

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more