Skip to content

Instantly share code, notes, and snippets.

@mattak
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattak/9583334 to your computer and use it in GitHub Desktop.
Save mattak/9583334 to your computer and use it in GitHub Desktop.
Android Record Program.
#!/bin/sh
SCREENRECORD_ANDROID_PATH=/sdcard/tmp.mp4
SCREENRECORD_LOCAL_PATH=tmp.mp4
TIME=10
SIZE=960x540
if [ $# -ge 1 ]; then
SCREENRECORD_LOCAL_PATH=$1
fi
if [ $# -ge 2 ]; then
TIME=$2
fi
adb shell screenrecord \
$SCREENRECORD_ANDROID_PATH \
--time-limit $TIME \
--size $SIZE
adb pull \
$SCREENRECORD_ANDROID_PATH \
$SCREENRECORD_LOCAL_PATH
adb shell rm \
$SCREENRECORD_ANDROID_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment