简体   繁体   中英

Terminate Logcat's -f output via shell on Android device

I am currently running logcat -v time -f /dir/to/file.log on an embedded Android device. Everything is running successfully and the log is piped to the file file.log .

However, I am unable to terminate logcat's piped output to the file. I am aware of CTRL C, but I am looking for a String based command that can be interpreted via Android's Runtime.getRuntime().exec() method.

My aim is to terminate the stream of data written to file.log . No other condition applies.

Did you consider looking at Process's documentation? I would figure destroy() should work for you.

ref

https://developer.android.com/reference/java/lang/Process.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM