Last active
August 29, 2015 14:09
-
-
Save ryanmr/34eb927d8ac0fa5ff7e5 to your computer and use it in GitHub Desktop.
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 | |
# don't forget to include ADB in your path | |
# for example, in your ~/.bashrc, somewhere near the top | |
# export PATH=$PATH:/path/to/android-sdk/sdk/platform-tools | |
# check if there is a filename | |
if [ -z "$1" ]; then | |
echo usage: $0 filename | |
exit | |
fi | |
FILENAME=$1 | |
# what to show when recording is stopped | |
control_c() { | |
echo -en "\n *** Stopping recording! *** \n" | |
echo -en "\n *** Use an Android File Explorer to access your video $FILENAME files on the device! *** \n" | |
exit $? | |
} | |
# trap the control-c interrupt | |
trap control_c SIGINT | |
# http://en.wikipedia.org/wiki/Bit_rate | |
BITRATE=9000000 | |
COUNTER=0 | |
MAXLENGTH=20 | |
echo "At anytime, CTRL+C to stop the recording!" | |
# run the loop | |
while [ $COUNTER -lt $MAXLENGTH ]; do | |
TARGET=$1-$COUNTER.mp4 | |
# echo "adb shell screenrecord --bit-rate "$BITRATE" --time-limit 180 /sdcard/"$TARGET | |
adb shell screenrecord --bit-rate $BITRATE --time-limit 180 "/sdcard/"$TARGET | |
let COUNTER=COUNTER+1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment