take screenshot android adb code example
Example 1: adb shell screenshot
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
Example 2: adb screenshot
adb exec-out screencap -p > screen.png
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
adb exec-out screencap -p > screen.png