java - 如何使用 "android.util.log"调试 cordova 插件和日志记录

标签 java android cordova logging plugins

我正在开发一个使用插件的 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"

重要提示: 我正在使用 netbeans 7.4,我无法从 netbeans 启动运行命令,因为它没有考虑根 config.xml 文件,导致重写我的设置,而且(不知道为什么),这个过程需要由于未检测到插件(安装了 peraphs),运行时间过多,每次从 git 获取时都要重新下载它们。

谢谢

最佳答案

您应该能够在 logcat 上使用 native 日志(Log.v、System.out)

您可以通过插件在 webview 控制台上打印

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

关于java - 如何使用 "android.util.log"调试 cordova 插件和日志记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27535145/

相关文章:

android - 如果 proguard 开启,生成 .apk 文件时出错

ios - CDVNotification插件在iOS中不起作用

java - 将消息放入集群队列

java - spring JPA 在 API 请求中发布

android - 更改 TextView 的文本颜色和背景

java - 为什么这个 JSON Parsing 越来越高效了?

android - 自定义卸载菜单 android

java - 添加 spring ws security 后 Weblogic 部署失败

java - 将bean注入(inject)到spring java配置类中

cordova - 图像区域选择以在 phonegap 中裁剪图像