Capturing Screenshot via ADB and saving directly in your PC
suggest changeOn current platform-tools, write the PNG straight to the computer. exec-out does not translate newlines, so the file stays a valid PNG:
adb exec-out screencap -p > screenshot.png
On older adb, adb shell turns newlines into \r\n and corrupts the PNG. Linux or Cygwin can strip those carriage returns:
adb shell screencap -p | sed 's/\r$//' > screenshot.png
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents