Skip to content

Instantly share code, notes, and snippets.

@charbgr
Last active October 26, 2016 13:52
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charbgr/c775d6914f25d40db6d4b1dc3a38f1df to your computer and use it in GitHub Desktop.
Save charbgr/c775d6914f25d40db6d4b1dc3a38f1df to your computer and use it in GitHub Desktop.
Android - Gif Recording Device
#!/bin/bash
adb shell screenrecord --bit-rate=20M "/sdcard/recording.mp4" &
PID=$!
echo "Recording.. ($PID)"
read -n1 -r -p "Press any key to stop" key
kill -SIGHUP $PID
sleep 1
adb pull "/sdcard/recording.mp4"
echo "Gififying..."
gifify -r 60 "recording.mp4"
echo "Removing from device..."
adb shell rm "/sdcard/recording.mp4"
@charbgr
Copy link
Author

charbgr commented Oct 25, 2016

Requires gifify.

You can find it from brew or npm etc.

@charbgr
Copy link
Author

charbgr commented Oct 25, 2016

Also give permissions using chmod +x record-gif.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment