Take Screenshot of Android screen and save to SD card

前端 未结 4 553
南旧
南旧 2021-01-16 09:00

There are a few questions here on SO about capturing screenshots of an android application. However, I haven\'t found a solid solution on how to take a screenshot programati

4条回答
  •  粉色の甜心
    2021-01-16 09:27

    You can look at http://codaset.com/jens-riboe/droidatscreen/wiki (with a write up at http://blog.ribomation.com/2010/01/droidscreen/): this is a Java library that uses adb to capture a screen shots. I've been able to (with a lot of elbow grease) modify the source to let me automatically capture a timed series of screen shots (which I use for demo videos).

    You can see the class structure at http://pastebin.com/hX5rQsSR

    EDIT: You'd invoke it (after bundling all the requirements) like this:

    java -cp DroidScreen.jar --adb "" --device "" --prefix "" --interval

提交回复
热议问题