Skip to content

Instantly share code, notes, and snippets.

@alfredo
Last active March 23, 2017 13:34
Show Gist options
  • Save alfredo/bf5e86b6f57a1d353c5a1624a5c48613 to your computer and use it in GitHub Desktop.
Save alfredo/bf5e86b6f57a1d353c5a1624a5c48613 to your computer and use it in GitHub Desktop.
adb record
alias adbrec='adb shell "screenrecord --bit-rate 8000000 --size 720x1280 /sdcard/vid.mp4"'
alias adbget='adb pull /sdcard/vid.mp4'
function adbrec () {
for i in "$@"
do
case $i in
-s=*|--size=*)
SIZE="${i#*=}"
shift # past argument=value
;;
-o=*|--output=*)
OUTPUT_FILE="${i#*=}"
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
# Default arguments:
if [ -z "${SIZE}" ]; then
SIZE=720x1280
fi
if [ -z "${OUTPUT_FILE}" ]; then
OUTPUT_FILE=/sdcard/vid.mp4
fi
echo "adb shell \"screenrecord --bit-rate 8000000 --size ${SIZE} ${OUTPUT_FILE}\""
}
function adbget () {
for i in "$@"
do
case $i in
-o=*|--output=*)
OUTPUT_FILE="${i#*=}"
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
if [ -z "${OUTPUT_FILE}" ]; then
OUTPUT_FILE=/sdcard/vid.mp4
fi
echo "adb pull ${OUTPUT_FILE}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment