Capturing Screenshot via ADB and saving directly in your PC

suggest change

On 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

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents