Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug cordova plugin and Logging with "android.util.log"

I'm developing a cordova app which make use of plugins.

One of this use the method Log.v from android.util.log.

Questions:

1) where does the plugin flush this logs? And how I can check them?

2) it's possibile to print something to console at runtime from the "java side"?  

I can only debug the javascript part through "crome://inspect" on Google Chrome
or 
via adb running the command "adb logcat CordovaApp:D *:S"

Important Note: I'm using netbeans 7.4 and I can't launch the run command from netbeans because it does not take into account the root config.xml file, causing a rewrite of my settings and also (don't know why), the process takes too much time to run because of undetected plugins (that peraphs are installed) and re-download them each time fetching from git.

Thank you

like image 701
user2548436 Avatar asked Dec 17 '14 21:12

user2548436


Video Answer


1 Answers

You should be able to se native logs (Log.v, System.out) on logcat

You can print on the webview console doing this from the plugin

webView.loadUrl("javascript:console.log('hello');");
like image 186
jcesarmobile Avatar answered Oct 07 '22 21:10

jcesarmobile