I'm trying to take a screenshot on my Android device with adb. I'm able to connect to my device and execute the commands, but the result is a corrupted file.
Im on a Ubuntu 14.04 system. My device is a Nexus 6 with Android 6.0 Beta on it.
I do the following:
adb shell screencap -p | sed 's/\r$//' > screenshot.png
I tried this as well:
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
I know it's also possible to use the pull method. But I prefer this one because it's faster.