Time for action – configuring iWebInspector for iOS debugging

In order to debug an Apache Cordova/PhoneGap app using iWebInspector, you have to perform the following steps:

  1. Find the application:didFinishLaunchingWithOptions method in the AppDelegate.m file.
  2. Add the following snippet of code inside the method (it works with iOS 5 and greater):
    Class class = NSClassFromString(@"WebView");
    [class performSelector: @selector(_enableRemoteInspector)];
  3. Once added the snippet creates a build.
  4. Run the app in the emulator.
  5. Use iWebInspector to load the app and play with the debug tools as you do when developing for the browser.
    Time for action – configuring iWebInspector for iOS debugging

What just happened?

The app can be inspected as an HTML page; you can use all the browser debug techniques when emulating the app.

Debugging with weinre

With the acronym weinre (WEb INspector REmote) developers refer to a debugger for web pages, such as Firebug (for Firefox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.147.190