In two ways we can see console.log messages
- Using WEINRE
- Using Eclipse
Method 1:
Use the WEINRE remote WEb Inspector in REmote. this is nodejs package. Steps to install WEINRE.
- Install nodejs
- run this command to install weinre:
npm install -g weinre (for MAC sudo npm install -g weinre ) - Then run WEINRE:
weinre --boundHost -all- --httpPort 8082 , here 8082 is the port number on which WEINRE is running. - Then add the following script tag to the HTML / web page you want to debug or view console messages,
<script src="http://xx.xx.xx.xx:8082/target/target-script-min.js#weinredemo"></script> xx.xx.xx.xx is the IP address of your machine.weinredemo is the identifier for your page, and you can use any of ours.- Then open the page where you want to see console messages on any mobile device.
- Open any webkit browser page,
http://localhost:8082/client/#weinredemo - Go to the console tab and view the messages.
Method 2:
- connect your mobile phone via USB and look at the phone specified in ECLIPSE, and you need to install the ANDROID ADT plugin for eclipse to view console messages in Eclipse.
Mohamed hussain
source share