How to debug cordova plugin and log using "android.util.log"

I am developing a cordova application that uses plugins.

One of them uses the Log.v method from android.util.log.

Questions:

1) where does the plugin flush this logs? And how I can check them? 2) it 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 am using netbeans 7.4 and I cannot run the run command from netbeans because it does not take into account the root.xml root file, causing me to overwrite my settings, and also (I don’t know why), the process takes too much time to start from - for undetected plugins (which are installed by peraphs) and re-download them every time you extract from git.

thanks

+6
source share
1 answer

You can have your own logs (Log.v, System.out) on logcat

You can print to the webview console using this from the plugin

 webView.loadUrl("javascript:console.log('hello');"); 
+6
source

Source: https://habr.com/ru/post/979810/


All Articles