DEV Community

kazi983
kazi983

Posted on

Android Wireless Debugging Using Mobile Hotspot

I recently ran into a frustrating issue while developing Android apps on the go: I wanted to test on my physical device, but wireless debugging wouldn't work over public free Wi-Fi. That's when I found this article and solved the problem. Here's my share of the method:

Original reference:
Zenn - Wireless adb debugging on the go

Also referenced: Qiita - adb wireless debugging item

1. Verify adb is in your PATH

where adb
Enter fullscreen mode Exit fullscreen mode

2. Add adb to PATH (if not found)

On Windows: Go to System Information → System Details → Environment Variables, then add this to your PATH and restart your terminal:

C:\Users\{YourUsername}\AppData\Local\Android\sdk\platform-tools
Enter fullscreen mode Exit fullscreen mode

3. Enable PC's Mobile Hotspot

Turn on the hotspot feature on your PC (one-click on Windows 11).

4. Connect Your Android Phone to the Hotspot

Connect your phone to your PC's hotspot network.

5. Pair with adb

  1. Navigate on your device: Settings → System → Developer Options → Wireless Debugging
  2. Enable "Use wireless debugging"
  3. Tap "Pair device with pairing code"
  4. Run this command with the code that appears:
$ adb pair <IP_address:port_number>
Enter pair code: <your_pair_code>
Enter fullscreen mode Exit fullscreen mode

6. Connect with adb

Your pairing is complete, but you're not connected yet. Use the IP address and port shown in your device's Wireless Debugging screen:

adb connect <IP_address:port>
Enter fullscreen mode Exit fullscreen mode

Once paired, you can connect in the future using just adb connect without re-pairing. Your Android Studio should now show your device as connected!

This works on Mac and Linux too—now you can develop anywhere on the go.

Top comments (0)