I would like to tell you today how to capture screenshots with command line. It’s rather easy.

  1. Download Android platform source code if you still don’t have it (http://source.android.com/).
  2. Find screenshot tool under \development\tools\screenshot\src\com\android\screenshot\. You have to compile it first.
  3. To compile just copy ddmlib from \development\tools\ddms\libs\ddmlib\src\com\android\ddmlib to the same folder. So you’ll have ddmlib and screenshot in \development\tools\screenshot\src\com\android\.
  4. Then run javac com/android/screenshot/Screenshot.java from \development\tools\screenshot\src\
  5. Attach the phone
  6. Run something like java com/android/screenshot/Screenshot -d 1.jpg. (You should have adb in you system variables path).