I need to make a short aux bash script to clear the logcat buffer and output afterwards in a file (new process).
The problem is that at every run I need to kill the previous process which dumps in the file (but I cannot kill the entire adb process).
adb -s $1 logcat -c adb -s $1 logcat -v time > $1.log &
$1 - the device id
I would like that the second command
adb -s $1 logcat -v time > $1.log & to run in a process named
$1 so I could kill it before running the other comands. Something like this:
pkill $1 adb -s $1 logcat -c adb -s $1 logcat -v time > $1.log &