Remote debugging now possible with Google Chrome developer tools

Updated on 10-May-2011

Recently Opera Software released the final version of their Dragonfly debugging tools that allow one to debug not only the the pages you are running in your local Opera instance, but also those running in remote instances of Opera on another computer, mobile or tablet. Now Google Chrome can boast of similar functionality.

As Google explains in its blog post announcing the functionality, due to Google Chrome’s model of isolating different tabs / sites in different processes, Google had already worked in having the debugger tools running in a separate process. Running the debugger in a remote process was a natural extension.

Google has not added this functionality in Google Chrome, but into WebKit itself, so other WebKit-based browsers will also be able to take advantage of the features. It might be possible for example, to debug the Android or iPhone browser using a browser installed on your PC. Although for this the browser using WebKit will have to expose the feature, and Android undoubtedly will.

According to instructions posted by Google, it is quite a simple matter to perform remote debugging. One needs to launch Google Chrome using the following commandline:

chrome.exe –remote-debugging-port=9222 –user-data-dir=remote-profile

Here the user-data-dir command line parameter specifies that a separate profile directory, other than your usual user directory is to be used. You can learn more about running Google Chrome with multiple user profiles here.

If one opens another Google Chrome instance on their computer and points it to http://localhost:9222 they will see a list of webpages open in their remote Chrome instance running the debugger. Clicking on one of the pages listed here will open the usual Chrome debugging interface in the browser.

Nearly all major browsers have embraced remote debugging, as this will only become more important as web apps take off on mobile devices. Mobile devices due to their smaller screen size, and limited input mechanisms aren’t very useful for debugging on. What would have been better though, would be to have one standardized protocol that all browsers could use for remote debugging, which might allow using any debugging tool with any browser. Although it is quite possible that major differences between the engines might be making this difficult.

 

Connect On :