I'm developing a JavaScript application that needs to run on the Google Android Phone OS. Is there a way to enable the JavaScript Error/Debug console within Safari on either the Android Emulator or an actual device? If so any instructions on how to do so would be appreciated.
6 Answers
It looks like, with the Android 2.0.1 SDK you'll need to filter on "browser" instead of "WebCore"

- 864
- 1
- 8
- 18
-
Also, just type: `adb logcat` to get the list of flags. I was looking for 'info' output, so I used: `adb logcat browser:I *:S` – Tyler Nov 30 '12 at 22:44
A quick Google turns up this blog post (posted after you asked your question), that should at least let you see any Javascript errors via the Android Debug Bridge using the command:
adb logcat WebCore:V *:S
Not quite the same as a full debug console though.

- 582
- 2
- 20

- 13,421
- 6
- 36
- 52
-
9For me it was adb logcat browser:W *:S. Anyone knows how to clean console? – SoulWanderer Dec 07 '10 at 14:40
-
on terminal? control+c, then type "clear", then twice arrow up and enter. – dsomnus Mar 26 '12 at 18:37
-
Same way if you run chromium on your mobile device adb logcat chromium:V *:S – Andre Miras Oct 28 '16 at 15:06
On Android write about:debug on the address line when the current page is the page you want to debug. you will get access to the console.

- 24,619
- 25
- 81
- 117
-
Note nothing will happen to confirm you've enabled the debug mode. But if you go to settings you'll find a "Debug" tab. Also, the console won't show unless there's something to show in it. – Jasper Oct 24 '13 at 17:27
-
I know your question is about Safari, but you might want to look into using Chrome instead. You can now use Chrome's desktop developer tools to debug and profile apps on your Android device.
Here's how:
- On Android Chrome, go to settings -> Developer tools and check "Enable USB Web debugging"
- On the desktop, run
adb forward tcp:9222 localabstract:chrome_devtools_remote
- Now on Desktop Chrome, navigate to localhost:9222.
You should see a list of the pages you have open on your phone. Click the one you want to debug/profile.
Detailed instructions are here

- 2,867
- 2
- 27
- 40

- 4,469
- 4
- 37
- 38
I have discovered that you can get this debugging information on the phone itself, without needingn to use adb or plug it into a computer, just download a log viewer.
Check the link for more info.

- 2,867
- 2
- 27
- 40

- 58,203
- 71
- 188
- 248
You can view the log and much more with weinre
From the Weinre docs
weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.

- 2,867
- 2
- 27
- 40

- 4,608
- 1
- 39
- 60