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

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


当前回答

今天也遇到了同样的问题。

显然,我也运行了eclipse,所有的logcat输出都被重定向到eclipse。由于日志只能在一个地方显示,请确保您没有运行多个调试器。

其他回答

确保在模拟器开发人员菜单选项中有记录器缓冲区大小适当值。

这不是一个技术性的答案,但您可能想要检查logcat的搜索框。如果输入了任何字符,你的logcat将为空,因为它将搜索特定的字符或单词,然后如果它不存在,你的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!!

在Android Studio 0.8.9中,我打开Android设备监视器,从设备列表中选择模拟器,并在LogCat选项卡中获得输出。

之后,我回到Android Studio的主视图,在Android DDMS选项卡的右侧选择Restore Logcat视图,它就在那里!

如果这不起作用,你可以在Android设备监视器中看到你的日志猫,就像我在第一句话中解释的那样。

对我来说,问题是我有两个名称相同的模拟器(我创建了它,删除了它,然后用相同的名称再次创建它)。在logcat下拉菜单中有两个模拟器条目,它连接到错误的一个。我所要做的就是换到另一个。我通过重命名模拟器永久地避免了这个问题。