Stop buffering of adb shell output

99封情书 提交于 2021-02-04 19:47:25

问题


I observed this new behavior in adb v1.0.39. The command:

adb shell getevent -l

gives the output below:

Observe that the last line is incomplete. This happens on many different devices. The same command is working without buffering in adb v1.0.32.

How do I stop adb shell output buffering in adb v1.0.39?


回答1:


Use adb exec-out instead of adb shell command to force the new adb to use the raw mode and avoid stdout buffering.

For more info read comments in adb/daemon/shell_service.cpp




回答2:


I don't see this behavior using adb 1.0.41.

Only while using tr which I use to delete "\r". In this case I use:

adb command ... | stdbuf -o0 tr -d $'\r'


来源:https://stackoverflow.com/questions/46233200/stop-buffering-of-adb-shell-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!