Remotely debug your web-site in Android phone

There was a light at the end of the tunnel. I have discovered something magical today. You can have you mobile web-site open on your phone, but debug it from your desktop.

It’s just pure magic!

Here is how to do it:

  1. Install Android SDK. Add  <sdk>/platform-tools/ to your PATH
  2. In Mobile Crome enable USB Debugging in Settings and connect your phone via usb to your PC
  3. In console run adb devices to check if you can see your device.
  4. In console run adb forward tcp:9222 localabstract:chrome_devtools_remote
  5. In your Desktop Chrome open http://localhost:9222
  6. Select the open tab from your mobile Chrome.
  7. Debug as normal.
  8. Profit!


Alternatively you can create a create a bat file with the following:

adb forward tcp:9222 localabstract:chrome_devtools_remote
start http://localhost:9222

And run this bat every time you connect your phone to your PC. For ease of use you can set up this as AutoPlay action in Windows 7 (if you know how to do that).

Hint: Autoplay handlers are located in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers But I have not managed to find out how to add the handler.