尝试将我的 LogCat 输出到文件
有人告诉我这是一个命令行选项。 占据了
-sdcard "C:\android-sdk-windows\tools\sd9m.img"
但是 Eclipse 的 Run!Run Configurations...!Target!Additional Emulator Command Line Options 字段已经被If I 想写这样的东西
adb logcat -s MessageBox > "C:\Users\me\Documents\LogCatOutput.txt"
,那么我应该在哪里写它,以及如何写(即语法是否正确)?我只需要输出过滤后的标签,而不是详细的。 (“MessageBox”是我的标签。同样,我不知道这些标点符号是否正确,甚至不知道命令的去向。)
感谢您的帮助。
I've been told it's a command line option. But Eclipse's Run!Run Configurations...!Target!Additional Emulator Command Line Options field is already occupied with
-sdcard "C:\android-sdk-windows\tools\sd9m.img"
If I wanted to write something like
adb logcat -s MessageBox > "C:\Users\me\Documents\LogCatOutput.txt"
then where do I write it, and how (i.e., is the syntax even correct)? I need to output only a filtered tag, not verbose. ("MessageBox" is my TAG. Again I don't know if any of this punctuation is right, or even where the command goes.)
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
或者,如果您只想转储 logcat 缓冲区中已有的内容并立即退出(对脚本有用),则可以指定 -d 选项:
确保“-d”位于“logcat”之后。
Alternatively, if you only want to dump whatever's already in the logcat buffers and exit immediately (useful for scripts), you can specify the -d option:
Make sure that '-d' is after 'logcat'.
上述答案的另一个有用的补充是过滤。我正在开发的应用程序会生成大量日志记录,因此使用过滤器进行日志记录非常有用。
或对于 OSX/Linux
这将写入除包含“: T#”的任何行之外的所有 logcat 活动
find
或 grep 也可用于根据肯定结果进行过滤。然后我使用 BareTail 之类的工具显示不断增长的日志文件。Another useful addition to the above answers is filtering. The application I am working on generates a massive amount of logging, so it is useful to log with filters.
or for OSX/Linux
This will write all logcat activity apart from any line that contains ": T#"
find
or grep can also be used to filter based on positive results. I then use the likes of BareTail display the growing log file.C:\android-sdk-windows\tools 中应该有一个 adb.exe 文件。您可以从 DOS 命令提示符手动调用它:
在这种情况下无需费心使用 Eclipse。
There should be an adb.exe file in C:\android-sdk-windows\tools. You can invoke this manually from a DOS command prompt:
There's no need to bother with Eclipse in this case.