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

有人能给我解释一下如何在Android Studio中使用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.

其他回答

在我的情况下,我发送空标签,即

Log.d("","My Log");

而是发送一个标记名称

Log.d("Class name","My Log");

希望它能帮助到别人

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

对我来说,问题在于设备是在“仅充电”模式下连接的。

将模式更改为媒体设备(MTP)(或在某些设备中传输文件)解决了问题。

查看LogCat Sitteng 在我的情况下,我不检查每一件事,使我

我再次检查一切为我工作

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

1)在android工作室。

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

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

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