Kalan's Blog

Software Engineer / Taiwanese / Life in Fukuoka

Current Theme light

category: iOS tag: iOS

It's quite troublesome to do screen recording. Every time I have to manually select the area. So I looked up if it's possible to record using the simulator, and it turns out it is, and surprisingly, it's very simple. Just run the following command in the command line:

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

After pressing ctl+c, the video file will be generated automatically. Just make sure there are no files with the same name. Additionally, because I often put repro on GitHub, which doesn't support video files, I convert them to gif using ffmpeg:

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

Later, I will gradually study the parameters of ffmpeg. In any case, this way you can convert video files to gif files. Awesome!

Prev

Rollup error encountered with Svelte with apollo-boost

Next

Svelte Notes (2): Compiler is more clever than you mess

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

Buy me a coffee

作者

Kalan 頭像照片,在淡水拍攝,淺藍背景

愷開 | Kalan

Hi, I'm Kai. I'm Taiwanese and moved to Japan in 2019 for work. Currently settled in Fukuoka. In addition to being familiar with frontend development, I also have experience in IoT, app development, backend, and electronics. Recently, I started playing electric guitar! Feel free to contact me via email for consultations or collaborations or music! I hope to connect with more people through this blog.