If you use Linux (or Windows with Cygwin), you can run:

adb shell screencap -p | sed 's/\\r$//' > screenshot.png