我如何模拟“尾巴” Android文件系统上的文件命令? [英] How I can simulate "tail" command for file on the Android file system?

查看:71
本文介绍了我如何模拟“尾巴” Android文件系统上的文件命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SD-CARD上有文件,并且我的应用程序将其用作日志文件。
是否可以通过adb实时监视所有更改的文件?
tail -f /sdcard/myfile.log 命令类似。

I have file on SD-CARD and my app using it as log file. Is it possible through the adb to watch file with all changes in real time? Like with tail -f /sdcard/myfile.log command.

推荐答案

这对我来说似乎很有效:

This seems to work great for me:

adb shell "while true; do cat; sleep 1; done < /sdcard/myfile.log"

这篇关于我如何模拟“尾巴” Android文件系统上的文件命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆