我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
就我而言,我试图用其他答案来解决这个问题,但没有结果。我无意中发现,空标签几乎从未显示(Android Studio 1.4)。因此,尝试在TAG中放入任何字母(空格无效)。
Log.wtf("x", "Android Studio Team, solve this, please!");
其他回答
在我的情况下,我发送空标签,即
Log.d("","My Log");
而是发送一个标记名称
Log.d("Class name","My Log");
希望它能帮助到别人
Easy fix that worked for me (after trying some of these other suggestion). My logcat was sitting blank in a separate window (on my second screen). Just had to drag the Logcat tab back to it's original place in the debug panel next to the Debugger and Console tabs, and VOILA... it began immediately updating and showing all processes verbose. So (If your logcat is anywhere outside of the debugger panel (i.e. the logcat tab isn't sitting nested alongside the debugger and console tab) then it won't receive updates and will sit there blankly. Don't know if this is an issue with older versions of Android Studio. But again, easy to try and if it works... it works!!
今天也遇到了同样的问题。
显然,我也运行了eclipse,所有的logcat输出都被重定向到eclipse。由于日志只能在一个地方显示,请确保您没有运行多个调试器。
Logcat的右边有一个小图标。您可以使用该图标打开和关闭logcat。我通常可以通过单击图标(可能几次)使logcat激活。
在android Studio应用程序中,您需要单击调试应用程序选项(Shift+f9)以调试模式运行并启用LogCat。