8

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.

Mohamed Hussain
  • 7,433
  • 14
  • 55
  • 85
  • may be [this](http://stackoverflow.com/questions/5538516/javascript-console-log-on-htc-android-devices-and-adb-logcat) link help you – Ram kiran Pachigolla Oct 17 '12 at 09:14
  • @Ram:Thanks but i tried this before asking this question i.e i enter about:debug in address bar , i am not seeing anything – Mohamed Hussain Oct 17 '12 at 09:16
  • see this which worked for my s2 standard with no hassle http://stackoverflow.com/questions/5538516/javascript-console-log-on-htc-android-devices-and-adb-logcat – Clark Jun 05 '14 at 17:04

2 Answers2

9

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.

merv
  • 67,214
  • 13
  • 180
  • 245
0

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.
Mohamed Hussain
  • 7,433
  • 14
  • 55
  • 85