Skip to content

Instantly share code, notes, and snippets.

@drunknbass
Created September 20, 2017 06:13
Show Gist options
  • Save drunknbass/6bba2c6b787c2426432342b54cbb8ed2 to your computer and use it in GitHub Desktop.
Save drunknbass/6bba2c6b787c2426432342b54cbb8ed2 to your computer and use it in GitHub Desktop.
iOS Simulator Video Utils
brew install gifsicle
brew install xquartz
brew install ffmpeg
gifType=".gif"
movType=".m4v"
timestring=`date +"%m_%d_%Y"`
capturePath=~/Desktop/ScreenRecording_$timestring
displayDialog () {
osascript -e 'display notification "Capture Saved to '$capturePath''$1'''" with title "Capture Saved"'
}
captureVideo () {
xcrun simctl io booted recordVideo $capturePath.m4v
}
alias simvid='captureVideo && displayDialog .m4v'
alias simgif='captureVideo && ffmpeg -i ~/Desktop/ScreenRecording_$timestring$movType -vf "scale=min(iw\,350):-1" -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=3 --delay=7 --colors 128 > ~/Desktop/ScreenRecording_$timestring$gifType && rm -f ~/Desktop/ScreenRecording_$timestring.m4v && displayDialog .gif'
a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment