title: is it possible to invoke ICS screen shot function from adb?
body: <p>I would need to be able to take screen dumps for testing, and with ICS there is now a screen shot function, that can be invoked by pressing (and holding) volume down and power button.
  Is there any way to script this function through adb? (As I understand it there's no public java API for it). I have tried to use KeyEvent from java to emulate power and volume button, and I have tried to use adb keyevent and adb sendevent without success. I suspect that the power button also generate some low level calls that are not generated with the above methods. </p>
  
  <p>So do anyone know if it is possible to call the function from adb?
  If this is not possible, do someone know where in the source code this screen shot function exist? Maybe I can figure something out by reading it.</p>
  
  <p><strong>update</strong></p>
  
  <p>source code for capture the screen is in "frameworks/base/services/surfaceflinger/services/surfaceflinger/SurfaceFlinger.cpp" in a function called screenCapture. I do not know if it is possible to call it from jni, but I will try, because it would be great if I could take a screen shot through java.</p>
  
  <p>Otherwise, @edthethird had a solution through android.amberfog.com/?p=168 that will make it possible to take a screenshot with the commandline.</p>
  
  <p>Thank you for the help everyone!</p>