我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
一些自定义rom出于性能原因禁用日志记录(尽可能压缩%)检查rom的内置应用程序或调整rom的菜单来启用此功能。
我在我的i9505上运行贵山的Galaxy S4 Rom,我不知道它默认禁用了日志记录,以获得最分钟的性能提升,但显然这在定制的“性能”导向型Rom上并不罕见。我花了一段时间才发现这一点-非常烦人,因为它会显示我有多少消息被记录,而不是他们的细节。
其他回答
我经常陷入这种状态。Logcat为空。调试工作,我可以击中断点。没有设置过滤器。日志级别为“Verbose”。我通过以下反复循环来修复它:
重新启动logcat(参见上面Zatziky的回答) 将日志级别更改为Debug(或其他级别),然后返回Verbose。 拔下并插回设备 运行adb kill-server && adb start-server 关闭Android Studio并在命令行上启动ddms。 重启Android Studio
最后,如果一切都失败了,重新启动计算机。
这个问题是间歇性的,我认为Android Studio就是有bug。
Easy fix that worked for me (after trying some of these other suggestion). My logcat was sitting blank in a separate window (on my second screen). Just had to drag the Logcat tab back to it's original place in the debug panel next to the Debugger and Console tabs, and VOILA... it began immediately updating and showing all processes verbose. So (If your logcat is anywhere outside of the debugger panel (i.e. the logcat tab isn't sitting nested alongside the debugger and console tab) then it won't receive updates and will sit there blankly. Don't know if this is an issue with older versions of Android Studio. But again, easy to try and if it works... it works!!
我找到了三种解法。
在Android 4.0设备上调试(我之前在Android Lollipop设备上运行它)。 单击DDMS中的重启按钮。 启动Android设备监视器,你会发现logcat。祝你好运~
确保在模拟器开发人员菜单选项中有记录器缓冲区大小适当值。
今天也遇到了同样的问题。
显然,我也运行了eclipse,所有的logcat输出都被重定向到eclipse。由于日志只能在一个地方显示,请确保您没有运行多个调试器。