I have problem with creating screenshot on Samsung Galaxy Young Duos phone - Android 2.3.6.
I use this code for other devices:
adb -s $devi shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $devi/Screen.png
And this is correctly working on other devices (Samsung Galaxy S3, Asus Nexus 7, Asus ME371MG - Android 4.X)
I tried other variants from this page without success.
There is error "permission denied" on that Samsung Young. Debug mode is set and Testdroid test on this device is able to do screenshots. And SDCard is inserted into this phone.