我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。

有人能给我解释一下如何在Android Studio中使用logcat吗?


当前回答

检查一下你是否把它藏起来了……如果它隐藏的问题,通过给定的图像显示它或ALT + 6

其他回答

重新启动logcat。它是固定的

我经常陷入这种状态。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 Studio打开多个窗口时,logcat只指向其中一个,而不一定是正在运行活动应用程序的那个。

例如,窗口1是我开发一字棋应用程序的地方,窗口2是我开发天气应用程序的地方。如果我在调试模式下运行天气应用程序,可能只有窗口1能够显示logcat条目。


试着关闭项目,然后重新打开它。这对我很有用。日志将重新出现。