How to Setup Weinre in PhoneGap

Posted By : Akhil Dhiman | 22-Sep-2014
 
weinre is WEb INspector REmote. It is the tool that is used to debug the cordova applications like firebug. With the help of this we can view Source code, local storage of our cordova application into browser.
 

How To Setup weinre:

  • You need to install node.js to your system.
  • After installation of node.js open terminal and type node -v.
  • If it returns you the version of node then node has been successfully installed.
  • Open Terminal
  • Type the following command.
 sudo npm -g install weinre
 
  • After the installation of weinre type the following command into terminal.
 ifconfig
 
  • ifconfig return you the ip address of your system.
  • Add the following script tag to the HTML source and build your project. Let your IP be 192.168.1.177
 
 
  • Type the following command to terminal to bound host with this.
 weinre --boundHost 192.168.1.177;
 
  • It will start the server with the IP 192.168.1.177
  • now run your project and go to Web browser and hit the following url http://192.168.1.177:8080/
  • The web page open. In Access Point there is one URL to debug client user interface. Hit that url.
  • Now in element tab you can view the source of your application running into simulator.
  • As you point on any HTML tag it will highlight the that tag into Simulator.
  • In Resources you can view your local storage.

 

Thanks

About Author

Author Image
Akhil Dhiman

Akhil is an iPhone and Android application developer with experience in PhoneGap and Swift(Native iOS). Akhil has good experience working with JavaScript, jQuery and Underscore as well.

Request for Proposal

Name is required

Comment is required

Sending message..