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

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


当前回答

我有同样的问题,但我解决了以下步骤,试一次。

1)在android工作室。

2)打开android Monitor窗口(android studio底部)

3)你可以看到右下角的下拉(旋转器)

4) select—只显示选中的应用程序。

其他回答

确保您选择了正确的模拟器,并且模拟器选择器旁边的字段不为空(在Logcat控制台中)。

在我的情况下,我只是过滤了输出,所以即使在重新启动Logcat等后,它也显示为空。

对我来说,它不仅适用于我的应用程序,它正在工作,如果没有选择过滤器(右侧的选项)。但我只需要看到我的应用程序,因此我发现,如果我做我自己的过滤器,过滤它的包名,它是工作,因为它应该。我希望它也能帮助到你:)

我刚把它修好了。在DDMS显示的最右边寻找恢复Devices Logcat视图和ADB视图的小图标。

When the DDMS first came up with both the "ADB Logs" and the "Devices | logcat" tab showing. The "Devices | logcat" is the one that should be showing the device output, but was blank. Somehow I managed to hide one or the other of those tabs, I forget exactly how. But, off to the right there was a tiny icon that said "Restore ADB" view, and I clicked it and it came up. Then there was another tiny icon that said "Restore Devices logcat view". I clicked that, and all of a sudden it appeared and was showing the device output again.

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