我昨天安装了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!!
其他回答
需要连续两次按“Alt+6”重新启动logcat窗口。这样它就会显示日志输出。
问题主要发生在调试模式。
奇怪的是,即使是在最近版本的Android Studio上,仍然会遇到这个问题。我通读了一长串的解决方案,但它们对我不起作用。 接受的答案适用于早期版本的Android Studio(我猜是v2.3)
我做了以下让Logcat再次工作:
Logcat >只显示选中的应用>不显示过滤器
Logcat >不过滤>只显示选中的应用
我期望重置logcat应该理想地给我同样的效果,但它没有。手动切换滤镜是唯一有效的方法。
这是在Android Studio 3.0.1(稳定)(我不能在完成当前项目之前更新它) 问题发生在我早上启动Android工作室继续我晚上留下的工作时。我希望开发人员能研究一下这个问题。从stackoverflow中尝试了超过15个解决方案,仍然没有看到任何结果。为这个问题的未来受害者揭示另一种解决方案甚至令人恼火。
**
如果你仍然被logcat为空所困扰,请阅读这篇文章
**
经过几个月的烦恼和麻烦,我刚刚解决了这个问题。 没有任何帮助,设备监视器在调试期间工作良好,但标准的logcat视图总是空的。
原因简单得令人恼火: logcat视图在那里,但它已被移动到0宽度的更新!
你在“ALT 6”选项卡,你看到两个选项卡“ADB日志”和“设备| logcat” Devices | logcat实际上意味着它由Devices和logcat组成,用垂直边界分隔。 垂直边界可以移动,在更新期间,它似乎已经移动到100%正确。
这将导致logcat被收集但不显示,将鼠标指针移动到工具窗口的右侧,并将logcat拖回视图。
这个解决方案不会帮助每个人,但我发现许多人与工作ADB连接仍然没有logcat输出,这些可能会受到同样的问题。
就我而言,我试图用其他答案来解决这个问题,但没有结果。我无意中发现,空标签几乎从未显示(Android Studio 1.4)。因此,尝试在TAG中放入任何字母(空格无效)。
Log.wtf("x", "Android Studio Team, solve this, please!");
检查log标记中是否有空格。如果标签由空格组成,则删除空格,然后运行。您将能够查看日志。