0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

iPhone Simulatorのgifを作成するShellScript

Last updated at Posted at 2021-04-02

動作環境

  • macOS

前提条件

  • ffmpegがインストールされていること

ShellScript

以下のファイルを isimgif という名前でPATHの通った場所に配置してください。

#!/bin/sh

date=`date +%Y%m%dT%H%M%S`
mov_name=isim_$date.mov
gif_name=isim_$date.gif
function stopped () {
  ffmpeg -i $mov_name -vf scale=320:-1 -r 10 $gif_name > /dev/null 2>&1
  echo "Created $mov_name and $gif_name"
}
trap 'stopped' 2
echo 'Simulatorの録画を開始します... 録画を終了する場合は、 Ctrl+C を押下してください'
xcrun simctl io booted recordVideo $mov_name

実行方法

% isimgif
Simulatorの録画を開始します... 録画を終了する場合は、 Ctrl+C を押下してください
Recording started
^CWrote video to: isim_20210402T130250.mov
Created isim_20210402T130250.mov and isim_20210402T130250.gif

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?