我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
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!!
其他回答
要运行Logcat,请重新启动Logcat,然后打开DDMS(要打开它,请单击Android DDMS右上角的Android图标)。设置“日志级别=调试”。然后运行你的应用。
试试@Robert Karl在这篇文章中提到的观点。如果没有工作,那么你肯定可以通过android设备监视器看到日志。
启动android设备监视器 选择DDMS透视图 然后选择屏幕截图所示的设备。 您可以根据您的要求应用过滤器
奇怪的是,即使是在最近版本的Android Studio上,仍然会遇到这个问题。我通读了一长串的解决方案,但它们对我不起作用。 接受的答案适用于早期版本的Android Studio(我猜是v2.3)
我做了以下让Logcat再次工作:
Logcat >只显示选中的应用>不显示过滤器
Logcat >不过滤>只显示选中的应用
我期望重置logcat应该理想地给我同样的效果,但它没有。手动切换滤镜是唯一有效的方法。
这是在Android Studio 3.0.1(稳定)(我不能在完成当前项目之前更新它) 问题发生在我早上启动Android工作室继续我晚上留下的工作时。我希望开发人员能研究一下这个问题。从stackoverflow中尝试了超过15个解决方案,仍然没有看到任何结果。为这个问题的未来受害者揭示另一种解决方案甚至令人恼火。
步骤1:连接你的手机与Android开发者选项和USB调试。
步骤2:进入“查看>工具窗口> Logcat”
第三步:在运行项目之前,确保你的手机连接Android Studio。然后运行应用
注意:如果不能显示Logcat,请重新启动Android Studio: File > Invalid Caches/ Restart
今天也遇到了同样的问题。
显然,我也运行了eclipse,所有的logcat输出都被重定向到eclipse。由于日志只能在一个地方显示,请确保您没有运行多个调试器。