Use subprocess.Popen to execute android "adb" command too slowly
<p>I use the subprocess.Popen to execute android adb command ("adb shell top -m 5 -s rss"), also use stdout=PIPE. So i can parse the stdout results. Code as follows:</p>

<pre><code>cmd = ['adb', 'shell', 'top', '-m', '5', '-s', 'rss']    
process = subprocess.Popen(cmd, bufsize=2048, stdout=PIPE, shell=False)
for line in process.stdout:
  # do something
</code></pre>

<p>My target is to get the RSS used top 5 processes. So the cmd as above.
The question is, actually, it is quite slowly to get the PIPE data. Almost 50 seconds.
Does anybody know the reason?</p>
