我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
重新启动logcat总是对我有帮助。
其他回答
这可能不是你的问题,但我发现当Android Studio打开多个窗口时,logcat只指向其中一个,而不一定是正在运行活动应用程序的那个。
例如,窗口1是我开发一字棋应用程序的地方,窗口2是我开发天气应用程序的地方。如果我在调试模式下运行天气应用程序,可能只有窗口1能够显示logcat条目。
重新启动Android Studio帮助了我。
尝试点击“Android”视图最右边的图标,你应该在Android视图上看到Logcat选项卡(你可以通过按Alt+6打开Android视图)
需要连续两次按“Alt+6”重新启动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.