Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get browser console errors in Android-Phonegap-app, possibly in Eclipse?

I have PhoneGap app running in Android. I need to see the browser log (not just the console.log()) so that I could see all the errors and possibly warnings. I am aware of this similar question, however, that doesn't solve my problem, because it deals only with console.log(). My app is crashing in Android 1.6 browser and I need to see why. There is probably some syntax detail, which all newer Android browsers don't mind, but 1.6 is probably complaining about something and I need to see what.

I am using Eclipse, so if it is possible to use it to see browser error console, it would be great. I am also aware of LogCat tool in Eclipse, but it doesn't show any output from PhoneGap internal browser at all. Please help, I am lost ;-)

like image 852
Frodik Avatar asked Jun 09 '11 08:06

Frodik


2 Answers

As of Phonegap 1.6 (Cordova), you can get console.log by watching the output from LogCat for the tag CordovaLog. If you are using Eclipse, you can add a new filter for phone gap logs. Just click the plus sign, choose whatever you want in the Filter name field and make sure to add: CordovaLog in the by Log Tag field.

like image 165
Wissem Avatar answered Nov 16 '22 02:11

Wissem


I'm afraid I don't think it's possible. I've certainly not been able to find a way of doing it as of yet.

I debug the JavaScript of my PhoneGap web applications by running them first in Chrome and stepping through the JS debugger. If you're not dependent on native API calls then this is probably the best method.

Please let me know if you find a better method.

Here's a reliable source that backs up what I've said: http://www.phonegap.com/2011/05/18/debugging-phonegap-javascript/

EDIT: I just found this https://chrome.google.com/webstore/detail/geelfhphabnejjhdalkjhgipohgpdnoc#

Looks like an excellent tool for what we are after! I'm going to try it out now.

like image 29
Jivings Avatar answered Nov 16 '22 00:11

Jivings