So I am running logcat on my Incredible 2 connected to my computer and am trying to debug a web app I am working on. Unfortunately, the device is spamming the console so I can't see any of my console.logs from my javascript. Does anyone know of a way to filter out everything but the console.logs coming from the browser? I tried running logcat with these options
adb logcat -s "console"
thinking it would filter out everything but the console, since the android docs says the the browser console.logs spit out in this format listed here:
Console: Hello World http://www.example.com/hello.html :82
http://developer.android.com/guide/webapps/debugging.html
anyone know the real trick to this? Thanks.
Update, in newer Android versions that is:
adb logcat browser:V *:S
Can console.log be used to specify a tag? If so, you can use logcat to get only entries with a given tag with this:
adb logcat MYTAG:V
Turns out that console.log() specifies a tag of WebCore automatically, so you should be able to filter things the way you want like this:
adb logcat WebCore:V *:S
This means, "Show me everything tagged WebCore, and nothing that isn't." Other people have had success using browser instead of WebCore (Is there a way to enable the JavaScript Error/Debug Console for Safari within Android?), so try both and see what works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With