Remote Chrome Debugging on CM10

2014-02-25 | #android, #solution, #webdev

Chrome remote debugging should be easy. On paper it is. With CyanogenMod 10 this does not seem to be the case.

Normally, with Chrome versions above 32 on desktop and mobile you should be able to simply enable USB-debugging on your phone, go to "about:inspect" in your desktop chrome, activate the discover checkbox aaaaand profit.

Sadly it's not that easy on CM10 with certain phones, in my case a S2, because the built in device discovery does not seem to work due to driver issues. Since I'm not in the mood to fiddle with modded USB-drivers for my phone I found another workflow, which google calls the "legacy workflow".

1. Make sure you have installed the latest Android SDK with the adb-binary included (see link).

2. Activate USB-debugging in the developer options of your phone's settings. If you haven't already activated the developer options, tab the build number in "settings > about this phone" 6 times continuously to do so.

3. Write a startup script for the adb-binary to connect your computer to your phone. In Windows this script would look like this:

c:\"Program Files"\ADT\sdk\platform-tools\adb forward tcp:9222 localabstract:chrome_devtools_remote

Save the script as a .bat/.sh and start it.

4. Go to about:inspect in your desktop chrome to find your device listed below with all debugging options present.

Now you should be able to normally browse pages on you mobile Chrome with all debugging information showing in the desktop's developer tools for the selected device. Sadly, with my phone, this tends to crash quite frequently, but not to a degree where it is getting unusable. I can't really say if this is due to special conditions with my setup or a general problem when using this legacy workflow.

To end debugging you can execute "adb kill-server".