My name is Jake Marsh.
I'm a developer, designer, and writer.

Subscribed via Push Notifications. You can also subscribe via RSS or Twitter.

Subscribe via RSS or Twitter.

Subscribe via Push Notifications, RSS or Twitter.

▸ Remote Debugging UIWebView

Hiedi Utley has completely brought the awesome with a way to use desktop Safari's WebKit inspector to debug iOS UIWebView objects:

Wow! What a day! While researching debugging techniques for an upcoming training class I am teaching on PhoneGap, I stumbled over a couple of blogs about a private API in iOS5 that will allow you to debug your UIWebViews right inside desktop Safari using the Web Inspector!

Enabling the trick requires part of a private API in iOS 5, so don't ship it. It does seem to work great though, and it's pretty simple:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Uncomment to enable remote debugging
    [NSClassFromString(@"WebView") _enableRemoteInspector];

    return YES;

Then open up desktop Safari and head over to http://localhost:9999. It requires that you be running iOS 5 and running inside the iOS Simulator, but still, what a HUGE help.

(via Mike Rundle)

Update: Turns out Nathan de Vries did a lot of the original research and discovery on this one, here's his original (and in-depth) write up of it: Enabling Remote Debugging via Private APIs in Mobile Safari

Vote on Hacker News