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

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


当前回答

Logcat的右边有一个小图标。您可以使用该图标打开和关闭logcat。我通常可以通过单击图标(可能几次)使logcat激活。

其他回答

就我而言,我试图用其他答案来解决这个问题,但没有结果。我无意中发现,空标签几乎从未显示(Android Studio 1.4)。因此,尝试在TAG中放入任何字母(空格无效)。

Log.wtf("x", "Android Studio Team, solve this, please!");

这不是一个技术性的答案,但您可能想要检查logcat的搜索框。如果输入了任何字符,你的logcat将为空,因为它将搜索特定的字符或单词,然后如果它不存在,你的logcat日志将完全为空。

全核解决方案。只有在尝试了所有其他方法后才使用这个方法,因为这将删除您所有的设置和首选项,以及存储的图像和所有使您的模拟器运行的东西,直到您重新安装和重新配置。以我为例,这两个步骤都花了大约20分钟,因为除了使用Darcula外,我没有进行太多自定义。

删除你的。androidstudiobeta配置文件目录

对于linux用户,这可以在/home/[username]/下找到。AndroidStudioBeta 对于windows用户,我不确定。在我看来,关于它的文件相当模糊。可能在C:\Users[你的用户]\Application Data下面

检查它是否工作,如果不能,然后重新安装SDK。

相当激烈,但我尝试了这个页面上的所有其他东西,连接设备,没有过滤器,重新启动服务,这个页面上的所有东西,它就是不工作。

我检查了答案,只是在检查我的日志时偶然发现我的错误。 确保右边的方框显示“只显示选定的应用程序”。我的显示的是“Firebase”,所以它显示了来自Firebase的消息。

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!!