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

后端 未结 4 1472
余生分开走
余生分开走 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:32

    There is a great app for this: Terminal IDE. It contains many linux commands, and it does not need root access. You can install it from GooglePlay. Is is free of charge (and open source, GPLv2).

    One of its best features is that it can be used through telnet. Start it on your phone, and type telnetd command. It will start a telnet daemon, which listens on port 8080 by default. After that you can connect it from your PC, with the following command: (use cygwin on windows)

    telnet 192.168.1.8 8080
    

    You should use your phone's IP address instead of the above one. After a successful connection you will have an arbitrary sized terminal on your PC, which is capable to run tail -f command on your phone. And many others, such as bash and all of its builtin commands.

提交回复
热议问题