Chrome Android Debugging

In this post, I cover connecting Chrome Dev Tools wirelessly to a mobile device. Many other guides seem to require a USB cable first, but we’re going wireless first.

There are a number of reasons you may need to do this and cannot use a USB cable. In my case, the desktop machine I was using has some rather stringent restrictions on the USB port which could lock me out if it was concerned about the device. Connecting wirelessly was a far less risky option.

I knew Chrome remote debugging was an option, but had never tried it, even wired. If you can use USB, you are probably better doing so. Debugging over wireless is very slow.

Steps

This guide is was produced using an Ubuntu 24.04 desktop and an Android 15 mobile device. The desktop steps should work for any Linux or Mac version I believe, so long as they support adb. For Windows, you may need to replace ./adb with .\adb.exe. The Android steps may be different for other versions of the OS.

  1. Download Android SDK platform tools

  2. Enable developer mode on the mobile device:

    1. Go to settings and find the version number. On my device is was Settings > About Device > Version > Version No.

    2. Press it a few times and you should start getting a toast message about developer mode. Keep pressing it until the toast says that developer mode is enabled.

      The Version settings page with Version No. highlighted used to enable developer mode

  3. Enable wireless debugging on the mobile device:

    1. Go back to settings and find “Developer Options”. On my device it was Settings > System & Updates > Developer Options.

    2. Find the option for “Wireless Debugging” and toggle the switch to on.

      The Developer Options page with the toggle switch for Wireless Debugging highlighted

    3. When prompted, press “Allow” to enable debugging on your current network. If you are on a trusted network, you can check the box to always allow.

      The dialog prompting for permission to allow debugging on the current network

    4. Tap the left side of the same “Wireless Debugging” item to open wireless debugging settings.

      The Developer Options page with the left side of the Wireless Debugging option highlighted for opening the Wireless Debug options

    5. Set the mobile device aside for now.

  4. Configure the wireless adb connection:

    1. On your desktop, open a terminal and navigate to the directory containing the adb executable.

    2. On the mobile device, select “Pair device with pairing code”.

      The Wireless Debugging page with the option to start pairing highlighted

      A dialog with a pairing code and connection details should appear:

      The pairing dialog showing information used to connect via adb

    3. On your desktop, run the following command using the IP address and port from the previous step.

      ./adb pair <ip-address>:<port>
      
    4. When prompted, enter the code displayed on your device. You should get a success message.

      ~$ adb pair 192.168.4.2:40625
      Enter pairing code: 123456
      Successfully paired to 192.168.4.2:40625
      
    5. Next, run the following command.

      The port should be the one on the “Wireless Debugging” settings page, NOT the port used for pairing..
      ./adb connect <ip-address>:<port>
      

      You should get a notification on the mobile device that wireless debugging is now connected.

      Notification showing that wireless debugging is connected

  5. Connect chrome devtools:

    1. Open chrome on both devices (you can also use chromium).

    2. On your PC, navigate to chrome://inspect/. You should see a list of all open tabs for the mobile device (it may take a few seconds to appear).

      Chrome inspect tools on the devices page showing the connected wireless device

    3. Click “Inspect” for the tab you want to debug

Result

You should now be able to debug any web page open on the mobile device. You can even interact with the preview to control the page on the device.

Chrome devtools open for the wireless device

It should be noted that this will be much slower than debugging in a local browser. Ideally, you only use this for diagnostics. With modern responsive design, there should be very few issues specific to a mobile device. It is however very useful for finding the cause of an issue, so that it can be more easily reproduced on a desktop browser.