我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
我找到了三种解法。
在Android 4.0设备上调试(我之前在Android Lollipop设备上运行它)。 单击DDMS中的重启按钮。 启动Android设备监视器,你会发现logcat。祝你好运~
其他回答
Windows用户:
使用脚本工具。确保您已经为系统设置了ADB环境。 Android Logcat脚本
保存到bat文件 编辑文件。用包id替换com.example.abc 双击打开文件或通过MobaXTerm打开(方便查找文本)
p/s:如果这个答案有帮助,让我们把我的回购星。谢谢!
要运行Logcat,请重新启动Logcat,然后打开DDMS(要打开它,请单击Android DDMS右上角的Android图标)。设置“日志级别=调试”。然后运行你的应用。
我刚把它修好了。在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.
需要连续两次按“Alt+6”重新启动logcat窗口。这样它就会显示日志输出。
问题主要发生在调试模式。
在我的情况下,我只是过滤了输出,所以即使在重新启动Logcat等后,它也显示为空。