如何阻止 LogCat 输出在 Eclipse 中自动滚动?
更新:这是 SDK 工具 R14 中的一个错误。该问题已在 2013 年 10 月 27 日发布的 R15 中得到修复。更新到最新版本可以解决已接受答案中建议的问题。
我使用 Eclipse 调试视图中的 LogCat 窗口来诊断和修复代码中的崩溃。我注意到,只要添加新行,LogCat 输出就会自动向下滚动(但只有在您自己滚动到底部之后)。
如果我正在等待异常堆栈跟踪出现,这很好,但如果我尝试读取日志中的某些内容并且底部继续添加更多行(它不断跳到底部,所以会非常烦人)我滚动回错误,然后它再次跳到底部)。
有什么方法可以让它在放置时保持在放置的位置,但在到达底部时继续自动滚动?
编辑:请注意,我知道过滤器,但我不认为这是问题的解决方案。
另一个编辑:如果我从底部向上滚动“足够远”,它会自动停止滚动。足够远的可能是5行,也可能是500行,这似乎与日志中有多少行有关。理想情况下,只要我距底部至少 1 行,它就会停止滚动。
UPDATE: This turned out to be a bug in R14 of the SDK tools. It has been fixed in R15 which was released on Oct/27/2013. Updating to the latest release solves the problem as suggested in the accepted answer.
I use the LogCat window in the Debug view in Eclipse to diagnose and fix crashes in my code. I've noticed that the LogCat output will automatically scroll down anytime new lines are added (but only after you scroll to the bottom yourself).
This is great if I'm waiting for an exception stacktrace to come up, but extremely annoying if I'm trying to read something in the log and more lines are continuing to be added at the bottom (it keeps jumping to the bottom, so I scroll back to the error, then it jumps to the bottom again).
Is there any way to make it stay where I've placed it, when I place it, but continue to scroll automatically when I reach the bottom?
EDIT: Please note, I'm aware of filters and I don't consider this a solution to the problem.
ANOTHER EDIT: If I scroll up "far enough" from the bottom, it stops scrolling automatically. Far enough might be 5 lines or it might be 500 lines, it seems to be related to how many lines are in the log. Ideally, it would stop scrolling as long as I was at least 1 line away from the bottom.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
在右上角的 LogCat 选项卡中,有一个向下箭头,其下方有一条线,可以启用
在旧版本中是一个暂停按钮
这应该可以解决问题!
In the LogCat tab on the upper far right there is a down pointing arrow with a line under it to enable
On older versions it's a pause button to
That should do the trick!
更新到最新版本。当您通过 Eclipse 构建启动应用程序时,新的 logcat 会自动将您的日志过滤到特定于应用程序的崩溃日志中。
update to the latest version. the new logcat automatically filters your logs into the app-specific crash logs when you build-launch your app via eclipse.
我不再遇到禁用选项的问题:根据滚动条位置自动启用/禁用滚动锁定。
窗口>首选项>安卓>日志猫>取消选中上面的选项。
就我而言,我使用的是 Eclipse + Android Developer Tools(内部版本:v22.6.2-1085508),
我建议如果我想使用 eclipse,请从此链接下载完整包:
http://developer.android.com/sdk/index.html
下载后,下载所有可用更新,较少 NDK。
I stopped having problems disable the option: Automatically enable / disable scroll lock based on the scrollbar position.
Window> Preferences> Android> Logcat> uncheck the option above.
In my case, I'm using Eclipse + Android Developer Tools (Build: v22.6.2-1085508)
I suggest that if I want to use eclipse, download the full package from this link:
http://developer.android.com/sdk/index.html
After downloading, download all available updates, less NDK.
这不是发生在我身上的事。如果我向上滚动,当新行到达 logcat 时,它不会自动向下滚动,直到我将其滚动到底部。
可能是因为Eclipse或者Android SDK版本的原因。我现在用的是最新的。
That's not what happens to me. If I scroll up it won't scroll down automatically when new lines come to the logcat until I scroll it to the bottom.
Maybe it's because of the Eclipse or the Android SDK version. I'm using the latest right now.
您可以在 shell 中执行
adb logcat
,并使用终端应用程序的滚动缓冲区和滚动功能来管理 logcat 输出。You can do
adb logcat
in a shell, and use your terminal app's scroll buffer and scrolling features to manage the logcat output.取消选中名为:
Uncheck the box called:
如果您只是调试崩溃,请单击主 logcat 的红色 (E)(错误)过滤器,并将过滤器选项卡设置为默认值,以查看应用程序报告的所有行。
最终会发生什么,当您的应用程序崩溃时,它会保持关闭状态,除非您选择要求重新启动。因此,logcat 中的最后一行将是崩溃报告。这是我调试崩溃的方法之一。
If you're only debugging crashes, click on the red (E) (error) filter for your main logcat, and keep your filter tab set to default to view all lines that are being reported by your application.
What ends up happening, when your application crashes it stays closed unless requested to restart by your choosing. So, the last lines in the logcat will be the crash report. This is one of the ways of how I debug crashes.
我还认为自最新更新以来它“更加激进”!当我向上滚动 10 行或更多行时,它实际上会停止自动滚动。
我最好的解决方案是单击您感兴趣的行。如果 logcat 向下滚动太多并且您不再看到您的行,只需按 ArrowUp 或 ArrowDown 跳回您正在查看的行。
I also think it is "more aggressive" since the latest update! And it actually stops auto-scrolling when I scroll 10 or more lines up.
The best solution I have is clicking in the line you are interested in. If the logcat scrolls down too far and you don't see your line any more just press ArrowUp or ArrowDown to jump back to the line you were looking at.
如果您在搜索框中输入 pid:pidofyourapp (在“设备”选项卡的“在线”列下编写),它将显示您在应用程序中编写的日志。
If you write pid:pidofyourapp (which is written under online column in Device tab) in the search box,it will show the logs you wrote in your application.