How to connect Android Phone Wirelessly to Chrome DevTools for debugging A link to the article
By Yurei TZK
Introduction#
I’ve been using adb for some time now and decided to document how I connect my phones to Chrome with minimal hassle. Unfortunately, many online tutorials are outdated or don’t work for me for some reason, so I created this guide to hopefully be more helpful!
Setup#
Enable Wireless Debugging#
On your phone:
-
Open the settings app and navigate to
System>Developer Options>Wireless debugging. -
Enable wireless debugging and note down your IP address.
-
If you’re using a VPN, ensure the IP address matches the one assigned by your Wi-Fi network in
Network & Internetsettings. If they don’t match, disable the VPN or check this GitHub issue for possible workarounds if you VPN has similar settings to Rethink DNS.
Pair the Devices#
On your phone:
-
Open the
Pair device with pairing codemenu in wireless debugging settings. -
Note down the pair code, IP address, and port.
On your PC:
- Kill the
adbserver if it was previously started to avoid potential issues:
adb kill-server- Start a new
adbserver:
adb start-server- Initiate pairing with your Android device (replace
<ip>and<port>with the values noted earlier):
adb pair ip:portEnter the PIN displayed on your phone when prompted. Upon successful pairing, you’ll see a message like Successfully paired to <ip>:<port> [guid=<device guid>].
Connect to Chrome#
- Connect to your device using the following command (note that
<port>will be different from the one you used on a previous step):
adb connect ip:portYou should see a message like connected to <ip>:<port>.
-
Open Chrome on your PC and navigate to
chrome://inspect/#devices. Also, open Chrome Browser on Android. -
If Chrome doesn’t forward dev tools automatically (happened to me on my recent phones for some reason):
adb forward tcp:9222 localabstract:chrome_devtools_remoteAlso, if Inspect button doesn’t work for you, try Inspect fallback instead. I barely noticed a difference, despite the fact my Chrome version don’t really match.
Final Words#
This is a bunch of my notes I turned into an article. Hopefully, it helps someone! If you encounter any issues or have suggestions for improvement, please let me know.