[python] adb logcat realtime processing -- subprocess

CMD_logcat_clean = 'adb logcat -c'
CMD = '''adb shell "logcat | grep abc"'''

subprocess.Popen(args = CMD_logcat_clean, stdin = None, stdout= None, stderr= None, shell = False)
p_obj = subprocess.Popen(args = CMD, stdin = None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell = False)

 

with p_obj:
  for line in p_obj.stdout:

 

posted @ 2021-07-21 08:53  dark_ness  阅读(202)  评论(0编辑  收藏  举报