亚行登录顶部窗口cygwin的文件 [英] log adb top to file in windows cygwin
问题描述
无法登录windows下我的应用程序的CPU使用率(以文件)。
Trying to log cpu usage (to file) of my app under windows.
首先,我试过这个usning CMD
First I tried this usning cmd
adb shell top | grep com.myapp > log.log
其中给出的grep不被识别为一个内部或外部命令,可操作的程序或批处理文件。我想Windows没有任何grep命令?
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?
然后我尝试相同的命令usning cygwin的终端。这导致了一个空日志文件即可。于是我就在同一个命令,但没有将其输出重定向
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
本返回的期望输出。我也试着重定向标准错误用2>&安培; 1。没有工作。
This returned the expected output. I've also tried redirecting stderr with "2>&1". Didn't work.
我在做什么错了?
推荐答案
我有同样的问题,--line缓冲的解决了这个问题。
I have got the same problem and --line-buffered solved it.
例如
亚行外壳顶部| grep的--line缓冲com.myapp> log.log
这篇关于亚行登录顶部窗口cygwin的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!