Skip to Content

Weinre is a tools that allows to debug web pages that are called by a (mobile) browser. While using a desktop browser the developer can choose from a large list of debugging tools, this is normally not the case when using a browser on a mobile device (Opera being the exception). The task of debugging a mobile web page that is embedded into a hybrid app is even more complex. Weinre helps by allowing debugging of mobile pages, it can be used to debug Phonegap applications or: Sybase Hybrid Web Container (HWC) apps.

For more information about Weinre, see the homepage at GitHub

A prerequisite for Weinre is node.js. See this document to learn how to install and run node.js.

Install Weinre

Easiest way: can node.js and execute the command: “npm install weinre”. Given that npm is able to connect to the internet. If that not is the case, you may have to install Weinre by compiling it from the source. Let’s do this.

Download

Download the Weinre sources from GitHub.

Installation

Pre-requisites

Make sure the file weinre.build/personal.properties is available. If not, use the file sample.personal.properties as a template.

To do an “official” build, modify the file build.properties

Before

#———————————————————–

# weinre version

#———————————————————–

WEINRE_VERSION: 2.0.0-pre

After

#———————————————————–

# weinre version

#———————————————————–

WEINRE_VERSION: 2.0.0


Run the build

Running the ant build task under Windows most likely won’t work, as some unix tools like zip are needed. Therefore, if you are using Windows, use cygwin to run ant and make sure ZIP is available in cygwin.

Result

/wp-content/uploads/2012/10/weinre1_149505.jpg

Run Weinre

Weinre is a web server running in node.js. To start Weinre, execute:

“node weinre.server/weinre –httpPort 9090“


Afterwards, Weinre is accessible under the URL: http://localhost:9090

/wp-content/uploads/2012/10/weinre2_149506.jpg

Use Weinre

Now Weinre is installed and ready to use. The last paragraph on the web page explains how to integrate Weinre into your mobile web page: insert the URL of the script into the page and the next time you call your mobile page, Weinre will show you some data you can use to improve the mobile page.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply