3

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.

Stardust
  • 31
  • 2

1 Answers1

0

hey this is how i screencap our app, though i am using win7

adb shell screencap /sdcard/screen.png

also, i don't know what's that weird tags. when you use android's native screen capture command, android saves it on Pictures/Screenshot if i remember it right. i am using a Samsung Galaxy Tab 3.

rmanalo
  • 342
  • 3
  • 23
  • The method you're using works to, but is slower. I want to take multiple screenshots for a long time. That's why I prefer the other method. – Stardust Apr 01 '16 at 08:04
  • yeah, it's a bit slow. do you want to create video or just multiple screenshots? – rmanalo Apr 01 '16 at 08:09