我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
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!!
其他回答
在我的情况下,我只是过滤了输出,所以即使在重新启动Logcat等后,它也显示为空。
我有同样的症状,但我的问题要简单得多,这真的是我的错误。我的滤镜设置错了。
解决方案只是验证我设置了正确的过滤器。
我经常陷入这种状态。Logcat为空。调试工作,我可以击中断点。没有设置过滤器。日志级别为“Verbose”。我通过以下反复循环来修复它:
重新启动logcat(参见上面Zatziky的回答) 将日志级别更改为Debug(或其他级别),然后返回Verbose。 拔下并插回设备 运行adb kill-server && adb start-server 关闭Android Studio并在命令行上启动ddms。 重启Android Studio
最后,如果一切都失败了,重新启动计算机。
这个问题是间歇性的,我认为Android Studio就是有bug。
**
如果你仍然被logcat为空所困扰,请阅读这篇文章
**
经过几个月的烦恼和麻烦,我刚刚解决了这个问题。 没有任何帮助,设备监视器在调试期间工作良好,但标准的logcat视图总是空的。
原因简单得令人恼火: logcat视图在那里,但它已被移动到0宽度的更新!
你在“ALT 6”选项卡,你看到两个选项卡“ADB日志”和“设备| logcat” Devices | logcat实际上意味着它由Devices和logcat组成,用垂直边界分隔。 垂直边界可以移动,在更新期间,它似乎已经移动到100%正确。
这将导致logcat被收集但不显示,将鼠标指针移动到工具窗口的右侧,并将logcat拖回视图。
这个解决方案不会帮助每个人,但我发现许多人与工作ADB连接仍然没有logcat输出,这些可能会受到同样的问题。
首先确保在您的设备中启用了开发人员选项。 设备已连接。 详细的。 只显示选中的应用程序。