You can accomplish this with MonkeyRunner instead of ADB by creating a screenshot.py file with the following contents:
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device = MonkeyRunner.waitForConnection() result = device.takeSnapshot() result.writeToFile('<some path>/screenshot.png','png')
and run it using the command (on Windows)
<android sdk path>\tools\monkeyrunner.bat <some path>\screenshot.py
source share