Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display console.log() output in PhoneGap app using Eclipse and HTC Desire HD?

I am developing PhoneGap webapp where I use some javascript, and sometimes I need to see console.log() output. I can easily see it when running in Chrome, it also works fine, when running this app in Android emulator - output of console.log() shows up in Eclipse LogCat window. But when I run this app on my HTC Desire HD, LogCat just shows some Android-specific output, but nothing coming from my webapp.

Anybody has idea how to display console.log() output from PhoneGap-app running on HTC Desire HD ?

like image 785
Frodik Avatar asked May 01 '11 08:05

Frodik


2 Answers

Another workaround is to use console.log() jsconsole.com

like image 115
Epeli Avatar answered Sep 28 '22 15:09

Epeli


See the PhoneGap mail list thread. Also, two stackoverflow threads here and here.

It seems that console.log is disabled on HTC devices running Android 2.2.

The best workaround I've found is to use weinre, which intercepts the console.log to show the output in its desktop browser console.

Update: PhoneGap 1.3.0 now supports console.log directly to LogCat from the HTC Evo without any workarounds. (The same program doesn't work with PhoneGap 1.1.0)

like image 32
Paul Beusterien Avatar answered Sep 28 '22 16:09

Paul Beusterien