如何调试cordova插件并使用"android.util.log"进行日志记录

use*_*436 7 java logging plugins android cordova

我正在开发一个使用插件的cordova应用程序.

其中一个使用android.util.log中的Log.v方法.

问题:

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"
Run Code Online (Sandbox Code Playgroud)

重要说明: 我正在使用netbeans 7.4并且我无法从netbeans启动run命令,因为它没有考虑root config.xml文件,导致重写我的设置以及(不知道原因),由于未检测到的插件(已安装peraphs)并且每次从git获取时重新下载它们,因此该过程需要花费太多时间才能运行.

谢谢

jce*_*ile 7

您应该能够在logcat上查看本机日志(Log.v,System.out)

您可以在webview控制台上打印,从插件中执行此操作

webView.loadUrl("javascript:console.log('hello');");
Run Code Online (Sandbox Code Playgroud)