简体   繁体   中英

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;-)

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.

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.

This is the tool that I use. Very handy and you can see a lot more then just console messages. You can interact with the mobile device (also PhoneGap apps) like chrome developer tools. I also think it is much better then Ripple. Debugging on the real device is always better!

http://debug.phonegap.com/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM