How to make GIF from Android device screen

血红的双手。 提交于 2019-12-14 02:52:30

问题


I can capture Android device screen:

adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > adb-screenshot-$(date +%Y%m%d-%H%M%S).png

How can I squash all those images into single GIF?


回答1:


Ok, I found it.

First done screenshots in single folder and then converted it all to GIF like this:

convert *.png screens.gif

Installed ImageMagick as described here.

On Mac OS X, I've installed it like this: brew install ImageMagick.




回答2:


You can use the convert command of ImageMagick to combine your .png files into one .gif animation :

convert -delay 10 -loop 0 *.png anim.gif



回答3:


You can use my fully working script here: android-screen-gif.sh. You simply run it with ./android-screen-gif.sh, let it record and hit Ctrl + C when you want to stop. The images will be pulled and a GIF assembled, very useful for demos/issue tracker/email! Requires convert to be on path, see the other posts here about ImageMagick.

Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-1.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-2.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-3.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-4.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-5.png
Downloading images.
pull: building file list...
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-5.png -> ./Screenshot-20150707-105440-5.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-4.png -> ./Screenshot-20150707-105440-4.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-3.png -> ./Screenshot-20150707-105440-3.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-2.png -> ./Screenshot-20150707-105440-2.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-1.png -> ./Screenshot-20150707-105440-1.png
5 files pulled. 0 files skipped.
6077 KB/s (5015743 bytes in 0.805s)
Assembled gif Screenshot-20150707-105440.gif
Cleaned up individual screenshots.


来源:https://stackoverflow.com/questions/23309085/how-to-make-gif-from-android-device-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!