我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了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.
在我的例子中,我从右边的小下拉列表中删除了“image”。在那之后一切都很好。这是因为它将在日志中搜索搜索框中的关键字,因此如果没有找到任何匹配项,它将返回空白
检查一下你是否把它藏起来了……如果它隐藏的问题,通过给定的图像显示它或ALT + 6
我检查了答案,只是在检查我的日志时偶然发现我的错误。 确保右边的方框显示“只显示选定的应用程序”。我的显示的是“Firebase”,所以它显示了来自Firebase的消息。
在Android 3.6.1中,我必须:
升级到最新的Android Studio版本(4.x.x) 重启Logcat 重启应用程序 重启Android Studio 重新启动Android测试设备