How I can simulate “tail” command for file on the Android file system?

后端 未结 4 1473
余生分开走
余生分开走 2021-02-14 23:47

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

4条回答
  •  孤街浪徒
    2021-02-15 00:47

    This seems to work great for me:

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

提交回复
热议问题