Home » Android » javascript – How to see Console log output in samsung galaxy S2

javascript – How to see Console log output in samsung galaxy S2

Posted by: admin June 15, 2020 Leave a comment

Questions:

I am using samsung galaxy s2 version 2.3.3, i open a web page in android default web browser.

In the Page i put console.log(“some info”) to debug the page, but i am unable to see the console.log output in my device.Please help me in this.Thanks in advance.

How to&Answers:

Warning: No Longer Working!

This solution appears to no longer be functional as the web tool has not been maintained over the years.


Try using JSConsole.com. It’s a remote debugger for JavaScript. The setup is basically just injecting a <script> tag in your page. Once connected you can read all the console.log calls from the remote page on JSConsole, as well as execute commands on the client.

Steps to Setup

  1. Go to JSConsole Home Page, and type :listen.
  2. Copy the resulting <script src="http://jsconsole.com/remote.js?..."></script>.
  3. Drop that into the page you need to debug.
  4. Open your page in any browser (phone, tablet, desktop, etc). All console.log calls will be forwarded to the JSConsole.com window.

There are more details plus a couple of useful videos on the Remote Debugging Page.

Answer:

In Two ways we can see console.log messages

  1. Using WEINRE
  2. Using Eclipse

Method 1:

Use WEINRE remote WEb Inspector in REmote. it is a nodejs package. Steps to install WEINRE.

  1. Install nodejs
  2. run this command to install weinre :npm install -g weinre (for
    MACsudo npm install -g weinre)
  3. Then launch WEINRE: weinre --boundHost -all- --httpPort 8082, here
    8082 is port number where WEINRE is launched.
  4. Then add the following script tag in the HTML/web page you want to
    debug or to see console messages, <script
    src="http://xx.xx.xx.xx:8082/target/target-script-min.js#weinredemo"></script>
  5. xx.xx.xx.xx is the IP of your machine.
  6. weinredemo is the ID for your page and you can use any of our own.
  7. Then open the page , where you want to see console messages in any mobile device.
  8. Open this page any webkit
    browser,http://localhost:8082/client/#weinredemo
  9. There go to console tab and see the messages.

Method 2:

  1. please connect your mobile via USB drive and see the phone listed in ECLIPSE and need to install ANDROID ADT plugin for eclipse to see the console messages in Eclipse.