Last active
May 20, 2020 11:58
-
-
Save romanfurman6/b08f85c3f16c27929f3caa2f491af360 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
# Functions for recording a video or taking a screenshot from the currently booted simulator and saving it in the Screenshots folder. | |
# Installation: put it in your .zshrc or .bashrc | |
# Usage: "$ simrec" or "$ simscr" in terminal | |
function simrec() { | |
currentDate=$(date "+%Y-%m-%d at %H.%M.%S") | |
screenshotsPath="$HOME/Screenshots" | |
fileName="Screen Recording ${currentDate}.mp4" | |
fullPath="${screenshotsPath}/${fileName}" | |
echo "Recording Video in ${fullPath}" | |
echo "You can stop recording by Ctrl+C" | |
xcrun simctl io booted recordVideo --code=h264 --force ${fullPath} | |
} | |
function simscr() { | |
currentDate=$(date "+%Y-%m-%d at %H.%M.%S") | |
screenshotsPath="$HOME/Screenshots" | |
fileName="Screenshot ${currentDate}.png" | |
fullPath="${screenshotsPath}/${fileName}" | |
xcrun simctl io booted screenshot --type=png ${fullPath} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment