显示 Cordova “console.log"Android Studio 中的条目 [英] Display Cordova "console.log" entries in Android Studio

查看:56
本文介绍了显示 Cordova “console.log"Android Studio 中的条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Vue.js 的 Cordova 应用程序,并使用标准的 Javascript/浏览器 console.log() 进行了大量日志记录.到目前为止,我只针对 iOS,而那些 console.log 消息会出现在 xCode 日志查看器中.

I have a Cordova app using Vue.js, and lots of logging using the standard Javascript/browser console.log(). Up until now I've only been targeting iOS, and those console.log messages appear in the xCode log viewer.

不过,现在我的目标也是 Android.我已成功将 Cordova 项目导入 Android Studio,并且该应用程序在模拟器中以调试模式运行.但是,我在任何地方都找不到 console.log 输出.

Now, however, I'm also targeting Android. I've successfully imported the Cordova project into Android Studio and the app is running in debug mode in the Emulator. But, I can't find the console.log output anywhere.

我认为日志输出应该出现在这里,但我的应用程序根本没有任何内容.

I think the log output should appear here, but there is nothing from my app at all.

我也试过 Logcat,正如@Lukasz 所描述的,它也没有效果:

I've also tried Logcat, as @Lukasz describes, which also had no effect:

推荐答案

我终于解决了这个问题.我必须在设置中启用开发人员选项并启用 USB 调试.

I finally resolved this. I had to enable Developer Options in settings and enable USB Debugging.

这篇关于显示 Cordova “console.log"Android Studio 中的条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆