将logcat打印到使用过滤器的文件?使用GREP?
我很容易通过这样做来打印我的logcat以提交文件:
Process process = Runtime.getRuntime().exec( "logcat -f test.txt");
但是我想根据匹配的单词过滤内容,我考虑使用grep
和操作员>
打印要文件,但这无效。没有创建文件。
Process process = Runtime.getRuntime().exec("logcat -d | grep -n \"System.out\" > test.txt");
I am very easily printing my logcat to file by doing this:
Process process = Runtime.getRuntime().exec( "logcat -f test.txt");
But I would like to filter the content based on matching words, I thought about using grep
and the operator >
to print to file but that didn't work. No file is being created.
Process process = Runtime.getRuntime().exec("logcat -d | grep -n \"System.out\" > test.txt");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论