Android: How to take screenshots from command line
I would like to tell you today how to capture screenshots with command line. It’s rather easy.
- Download Android platform source code if you still don’t have it (http://source.android.com/).
- Find screenshot tool under \development\tools\screenshot\src\com\android\screenshot\. You have to compile it first.
- 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\.
- Then run javac com/android/screenshot/Screenshot.java from \development\tools\screenshot\src\
- Attach the phone
- Run something like java com/android/screenshot/Screenshot -d 1.jpg. (You should have adb in you system variables path).