title: how to get "adb device" to work when using Popen() with env
body: <p>the original code is <a href="https://stackoverflow.com/questions/14779146/how-can-i-get-the-info-in-cmd-when-i-set-adb-trace-adb/">here</a></p>
  
  <pre><code>import subprocess as sp
  
  cmd = ["adb","push","file","/mnt/sdcard/file"]
  mysp = sp.popen(cmd, env={'ADB_TRACE':'adb'}, stdout=sp.PIPE, stderr=sp.PIPE)
  stdout,stderr = mysp.communicate()
  
  if mysp.returncode != 0:
      print stderr
  else:
      print stdout
  </code></pre>
  
  <p>it works fine without <code>env={'ADB_TRACE':'adb'}</code>.</p>
  
  <p>exec any command about <code>adb</code> with the env variable, i got an error:</p>
  
  <pre><code>ADB server didn't ACK
  * failed to start daemon *
  error: cannot connect to daemon
  </code></pre>
  
  <p>it seems not to work after kill the adb server</p>
  
  <p>the whole output is <a href="http://pastebin.com/CxbByGDW" rel="nofollow noreferrer">here</a></p>
  
  <p>OS:win7</p>