Thursday, February 20, 2014

Adb shell Android getevent information will be redirected to a text file, why would a cache case




This two-day encounter a very strange thing, is printf information android executable file will be redirected to a text file, the system will often only about 4k buffer contents to the output file, are executed directly in the shell can be real-time information, and more than getevent, other commands will have the same situation, I need to redirect after the real-time information can be obtained, please feel predecessors pointing grateful ......<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
This system should be redirected at the time, the update causes it, that is, the print information only when the system has been defined to display not kept pace
Reply:
This determination should not display delay, himself wrote a test program, call fflush (stdout) after printf can get real-time information, refer to:
http://blog.csdn.net/melanie327/article/details/8275909
http://womeikongya.blog.163.com/blog/static/58599220201011215143125/

The problem is that a third party has a good compiler command can not be modified, so there is no way to disable this buffer, or use other means to target command buffer flush it?
Reply:
http://blog.csdn.net/silyvin/article/details/8281342

http://www.cnblogs.com/Anker/archive/2012/12/25/2832568.html

http://www.51testing.com/?uid-292219-action-viewspace-itemid-821656

Code:
# Ifdef HAVE_POSIX_OPENPT
int fd = posix_openpt (O_RDWR);
# Else
int fd = open ("/ dev / ptmx", O_RDWR);
# Endif / / HAVE_POSIX_OPENPT

Tangled over two days, problem solving, 'pseudo-terminal'
Reply:
Can you teach about how to get real-time log of my getevent unfamiliar grateful for C

No comments:

Post a Comment