Web Debugging on iPhone, iPad and PhoneGap apps

There is a new version available! iWebInspector 0.91 supports Xcode 4.3 and iOS 5.1 SDK. Download

iWebInspector is a free tool to debug, profile and inspect web applications running on iOS Simulator (iPhone or iPad), starting with version 5.0.

This tool enables a private API available on the iOS 5 framework inside the simulator and it can be used for Safari (the web browser) for any webpage, for a chrome-less installed webapp (aka full-screen webapps) and for a PhoneGap application -including apps using UIWebView.

To use this tool you need Xcode with iOS 5 SDK. If you don't have it, search for it in Mac App Store. While the web inspector is enabled, you can also use Safari for Mac. Just point the browser to http://localhost:9999.

Help and support information on www.iwebinspector.com

This tool was created by Max Firtman, @firt. Any feedback is welcome by Twitter or by email [my surname]@gmail.com.

The Remote Web Inspector is part of the open-source WebKit project and is included in iOS5 by Apple.

Some platform limitations include console messages logging and offline data storage information. You can check the Weinre project if you need those features.








Why iWebInspector is not working in Mountain Lion (Mac OS 10.8)?

The problem resides not in the app, but in Safari 6.0 that comes by default in Mountain Lion.

The shorter version: Safari 6.0 (the rendering engine for the inspector) supports only the latest version of the Web Socket protocol and not the version that Safari for iOS and the Web View are using (a deprecated version)

The larger version: Safari on iOS 5.0/5.1 and the UIWebView on same versions uses WebSocket hixie-76 (also known as hybi-00) for the server. Safari 6.0 dropped support for this version and it only supports RFC 6455 so now Safari (and in consecuence iWebInspector) can't communicate with the server.

A solution

A WebKit-based browser working on Mac OS 10.8 with hixie-76 support is Chromium up to version 12, so you can go here and download it. Then, open iWebInspector (or use _enableRemoteInspector if creating native web apps) and after it crashes, just open Chroumium 12 and go to http://localhost:9999. Thanks to @iTorrey for the finding!

iOS 6 will support remote debugging natively so you will be able to use that feature instead of iWebInspector. In the meantime, my suggestion is not to upgrade to Mountain Lion and Safari 6.0 if iWebInspector (or the manual debugger activation) is a matter of life or death.