Last active
June 18, 2019 12:28
-
-
Save frapontillo/6bf859b062f03c2e06f9564bc7d2efb9 to your computer and use it in GitHub Desktop.
Record Android screen straight to GIF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4 | |
else | |
shot_path="$*" | |
fi | |
# Enable show taps on screen | |
adb shell content insert --uri content://settings/system --bind name:s:show_touches --bind value:i:1 | |
adb shell am broadcast -a com.android.systemui.demo -e command enter | |
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e datatype lte -e level 4 | |
adb shell am broadcast -a com.android.systemui.demo -e command battery -e level 100 -e plugged false | |
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4 | |
# Tweak this if you want the clock to changed | |
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 0900 | |
# Remove this if you want notifications to be availalbe | |
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false | |
echo "When finished press CTRL-C" | |
adb shell screenrecord --bit-rate 6000000 /sdcard/Movies/$shot_path | |
echo "** Trapped CTRL-C" | |
echo "** Downloading screencast" | |
sleep 2 | |
adb shell am broadcast -a com.android.systemui.demo -e command exit | |
# Disable show taps on screen | |
adb shell content insert --uri content://settings/system --bind name:s:show_touches --bind value:i:0 | |
adb pull /sdcard/Movies/$shot_path . | |
adb shell rm /sdcard/Movies/$shot_path | |
giffify.py $shot_path -f 15 -dh 700 | |
rm $shot_path | |
adb shell am broadcast -a com.android.systemui.demo -e command exit | |
echo "Finished!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note this needs
giffify
from http://bit.ly/get-giffify to work :)