How to debug BlackBerry web applications using Web Inspector

by Retired on ‎08-19-2011 02:06 PM - edited on ‎06-06-2012 01:07 PM by Retired (10,857 Views)

Applies to:

 

  • BlackBerry® 7 device software
  • BlackBerry® Tablet OS

 

The Web Inspector tool is a debugging and profiling development tool for web content that is included as part of the WebKit rendering engine.

 

Note: Web Inspector support is not available if device encryption is enabled (for Smartphone device software).

 

 

Enable Web Inspector:


For content loaded in the BlackBerry Tablet OS browser:

 

  1. Enable Wi-Fi®.
  2. Open your browser and navigate to a Web page.
  3. Open the browser options screen and select the Privacy & Security tab.
  4. Switch "Enable Web Inspector" to On.
  5. Record the value of the IP address and Port number.
  6. When prompted, enter your BlackBerry PlayBook tablet device password.

 

PlayBook_Angle16_sm.jpg

 

For content loaded in the BlackBerry 7 browser:

 

  1. Enable WiFi.
  2. Open your browser and navigate to a Web page.
  3. From the browser menu, expand the Developer Tools menu item.
  4. Select Enable Web Inspector*.
  5. Record the value of the IP address and Port number.

 

enable_wi.jpg

 

* If you do not see the "Enable Web Inspector" menu option, open the browser Options screen and enable the "Enable Developer Tools" checkbox.

 


For content loaded in a BlackBerry® WebWorks™ application:

 

You can use Web Inspector to debug and profile a BlackBerry WebWorks application running on a live device.

 

  1. When building your application using the WebWorks SDK for Tablet OS, provide the -d command line argument.  This will automatically enable Web inspector connectivity for your application running on a Tablet OS in developer mode.

 

bbwp.exe c:\sandbox\myApp\myApp.zip –d

 

2. When building your application using the WebWorks SDK for Smartphone, provide the /d command line argument.  This will automatically enable Web inspector connectivity for your application running on a BlackBerry Smartphone.

bbwp.exe c:\sandbox\myApp\myApp.zip/

When you first launch your compiled application, you will be prompted with the address and IP address of your BlackBerry Smartphone that you will need to use Web Inspector:

 

webinspector_online.jpg

 

 

Note: You do NOT need to enable Web Inspector from the browser in order to inspect a BlackBerry WebWorks application. These are independent instances of Web Inspector and it is important to recognize that enabling one does not enable the other.

 

 

Using Web Inspector:

 

  1. Open a desktop web browser such as Google® Chrome™, Mozilla® Firefox®, Safari or, Windows® Internet Explorer®.
  2. In the address bar, enter the IP address and port 1337 of the target device. (e.g. http://198.168.1.7:1337).
  3. You will be prompted with a list of page titles for content that has been loaded into memory by the Web Inspector tool (such as browser content or a BlackBerry WebWorks application).
  4. Click on any of the page titles to begin using the Web Inspector tool to debug and profile your Web content.

Web Inspector connecting to the BlackBerry browser or your WebWorks application

wi_start_screen.jpg

Measuring page load times and sizes using Web Inspector

resources_tool.png

More Info

For content loaded in a BlackBerry WebWorks application (Tablet OS)

You can use Web Inspector to debug and profile a BlackBerry WebWorks application running on a live device

  1. When building your application, provide the -d command line argument.This will automatically enable Web inspector connectivity for your application running on a Tablet OS in developer mode.