Trying to log cpu usage (to file) of my app under windows.
First I tried this usning cmd
adb shell top | grep com.myapp > log.log
Which gives "grep is not recognized as an internal or external command, operable program or batch file.". I guess windows doesn't any grep command?
Then I tried the same command usning cygwin terminal. This resulted in an empty logfile. So I ran the same command but without redirecting the output
adb shell top | grep com.myapp
This returned the expected output. I've also tried redirecting stderr with "2>&1". Didn't work.
What am I doing wrong?
I have got the same problem and --line-buffered solved it.
For example
adb shell top | grep --line-buffered com.myapp > log.log