More information of gradle-screen-record
with rich pictures, please see this blog:
http://blog.csdn.net/a153614131/article/details/54137734
- Mac osx
Gradle is required.
Make sure these tools installed,or else install them first:
- adb: We use it to get screen-record files with
.mp4
format. - ffmpeg: We use it to convert the format of these files, from
.mp4
to.gif
.
More infomation about Prepare tools
Apply gradle-screen-record
in rootProject/build.gradle,
don't forget to Sync Gradle !!!:
apply from: "https://raw.githubusercontent.com/fashare2015/gradle-screen-record/master/screen-record.gradle"
excute gradle cmd with three params:
- PfileName: [Required] Name of output gif**(without postfix)**.
- Psize: [Optional] Size of output gif.
- Ptime: [Optional] Time of output gif.
For example:
./gradlew screenRecord -PfileName=test
Or:
./gradlew screenRecord -PfileName=test -Psize=1080x1920 -Ptime=5
When you see "> Building 50% > :screenRecord" in the terminal, the screen recording is begining. Just operate your modile phone as you want, and it will stop after "-Ptime" second.
You will find the generated gif file in rootProject/screen-record/test.gif !!!
By the way, add it to git~
git add screen-record/.
support for windows.
Make issues or pull request, if you have good ideas ~
Helper to upload Gradle Android Artifacts to Maven repositories