Created
September 7, 2020 12:24
-
-
Save lxlgarnett/e7c57998de26a149e633a9acdd4306a7 to your computer and use it in GitHub Desktop.
Records screen record of Android device by using adb command.
This file contains hidden or 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 | |
date_string=`date +%F-%s` | |
# Creates Screenrecords directory if not exist. | |
mkdir -p Screenrecords | |
function finish() { | |
adb shell pkill -SIGINT screenrecord | |
adb pull /sdcard/screenrecord_"$date_string".mp4 ./Screenrecords/ | |
adb shell rm /sdcard/screenrecord_"$date_string".mp4 | |
} | |
trap finish SIGINT | |
printf "Press Ctrl+C to stop screen recording.\n" | |
adb shell screenrecord /sdcard/screenrecord_"$date_string".mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@starikcetin
That's great. Thank you