p0 = subprocess.Popen("adb shell screencap -p /sdcard/screen2.png",shell= True,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
stdin = subprocess.PIPE)
import time
time.sleep(0.2)
p1 = subprocess.Popen("adb pull /sdcard/screen2.png",shell= True,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
stdin = subprocess.PIPE)
print(p1.stdout.readlines()[0].decode())
p2 = subprocess.Popen("adb shell rm -rf /sdcard/screen2.png",shell= True,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
stdin = subprocess.PIPE)