[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:

原文地址:https://www.cnblogs.com/galaxy-tek/p/15037975.html