How to install and run Weinre
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.
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 the Weinre sources from GitHub.
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
# weinre version
# weinre version
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.
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
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.
Nice blog Tobias... should have searched SCN before going through the process myself 🙂
Lesson learned? 😆