logo
  • 現在做什麼
  • 關於我

Kalan

文章分類

  • 前端
  • 開發筆記
  • 雜談
  • 年度回顧

快速連結

  • 現在做什麼
  • 關於我
  • 聯絡我
  • 職涯思考🔗

關注我

在福岡生活的開發者,分享軟體開發與日本生活的點點滴滴。

© 2025 Kalan Made with ❤️. All rights reserved.

How to record video using XCode Simulator

Written byKalanKalanApr 27, 2020
Home/Dev Note
💡

If you have any questions or feedback, pleasefill out this form

Japanese原文

Table of Contents

    This post is translated by ChatGPT and originally written in Mandarin, so there may be some inaccuracies or mistakes.

    Using screen recording can be quite cumbersome, especially since you have to manually adjust the frame each time. So, I looked into whether it was possible to record video using the simulator, and I found that it actually is—and surprisingly simple too! You just need to use a command line instruction:

    xcrun simctl io booted recordVideo --codec=h264 transition.mp4

    After pressing ctl+c, the video file will be automatically generated. Just make sure that there are no files with the same name. Additionally, since I often upload my repros to GitHub, and GitHub doesn’t support video files, I use ffmpeg to convert them into GIF files:

    ffmpeg -ss 2 -t 20 -i YOUR_VIDEO_NAME -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 OUTPUT.gif

    Then I’ll take my time to study the parameters of ffmpeg. In any case, this way I can convert video files into GIF files—awesome!

    ← Rollup error encountered with Svelte with apollo-boostSvelte Notes (2): Compiler is more clever than you mess →

    If you found this article helpful, please consider buying me a coffee ☕ It'll make my ordinary day shine ✨

    ☕Buy me a coffee