我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
重新启动logcat。它是固定的
其他回答
奇怪的是,即使是在最近版本的Android Studio上,仍然会遇到这个问题。我通读了一长串的解决方案,但它们对我不起作用。 接受的答案适用于早期版本的Android Studio(我猜是v2.3)
我做了以下让Logcat再次工作:
Logcat >只显示选中的应用>不显示过滤器
Logcat >不过滤>只显示选中的应用
我期望重置logcat应该理想地给我同样的效果,但它没有。手动切换滤镜是唯一有效的方法。
这是在Android Studio 3.0.1(稳定)(我不能在完成当前项目之前更新它) 问题发生在我早上启动Android工作室继续我晚上留下的工作时。我希望开发人员能研究一下这个问题。从stackoverflow中尝试了超过15个解决方案,仍然没有看到任何结果。为这个问题的未来受害者揭示另一种解决方案甚至令人恼火。
试着关闭项目,然后重新打开它。这对我很有用。日志将重新出现。
如果同时使用多个版本的adb, Logcat可能会失败。一个在Android Studio,一个在终端。
你可能有不同版本的adb: sudo apt-get install android-tools-adb将创建/usr/bin/adb Android SDK包含{Android - SDK}/platform-tools/adb, 或者从创建/host/linux-x86/bin/adb的AOSP构建的输出
要查看这个问题是否影响到你,使用“Help -> Show Log in Files”打开idea.log,并寻找类似于“Initializing adb using:/home/repkap11/android-sdk/platform-tools/adb”的行。将此路径与终端中的“which adb”进行比较。如果它们不匹配,这个问题就会影响到您。
Android studio寻找{Android -sdk}/platform-tools/adb,并不关心你的PATH。我用符号链接替换了android-sdk中的adb版本,但简单地“sudo apt-get remove android-tools-adb”也可以。
所有这些都无济于事,我的日志猫功能失常。
After a lot of angry searching I found a solution that seems to work: 1. Make sure logcat itself is working (use DDMS from Tools->Android) and if it does close DDMS window again 2. Now go to Tab 5 (Debug), there select Logcat (this is not the same logcat as in Window 6!) 3. The window is empty just like Window 6, but now start a debugging run. For me logcat in the Debug window now started to show all the stuff again! Also when normally running the application the Debug->logcat view is still functional while the Tool Window #6 "logcat" is disfunctional as before
这是一个黑客,但是它会导致正常的logcat行为,突出显示您调试和开发所需的行和语法。 从现在开始,您需要通过调试窗口访问它。
尝试点击“Android”视图最右边的图标,你应该在Android视图上看到Logcat选项卡(你可以通过按Alt+6打开Android视图)