the original code is here
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
it works fine without env={'ADB_TRACE':'adb'}
.
exec any command about adb
with the env variable, i got an error:
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
it seems not to work after kill the adb server
the whole output is here
OS:win7