Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recording iOS Simulator produces empty files

I am trying to record the screen of my iOS 11.4 simulator with xcrun simctl io booted recordVideo recording.mov. This creates a file with that name, but unfortunately that file always has the size of 0 byte. Playing around with the --type parameter did not help either. Occasionally there was a playable file, which also was corrupted to a degree, as this file had a distorted look to it when opened in QuickTime. VLC could not play it at all.

I am using Xcode 9.4.1 on a 2014 MacBook Pro with discrete GPU, so Metal is supported.

Does anyone have suggestions to solve my problem?

like image 896
NKO Avatar asked Jun 28 '18 14:06

NKO


People also ask

Where do IOS simulator recordings go?

to record a video in IOS Simulator. Open File menu > Record Screen or ⌘ - command + R . Simulator saves screenshot file on (logged-in user's) desktop and it's the default path.

Where are Xcode simulator recordings saved?

After finishing the recording, you can click the Stop button and the video preview will appear next to the simulator. By dismissing the video preview, the recording will be saved in the Desktop folder.

What is Simctl?

Simctl is a tool to help manage and programmatically interface with the simulator. You can access simctl using the xcrun command-line tool. Now, you'll explore several of these subcommands. Run the following: xcrun simctl list. The list command shows the list of all the available devices and the runtimes.


2 Answers

There was a timing bug in video recording that could result in 0-byte files on some systems. I'm sorry, but there is unfortunately no workaround. This should be addressed with changes in Xcode 10 Beta 3+.

like image 61
Jeremy Huddleston Sequoia Avatar answered Sep 22 '22 00:09

Jeremy Huddleston Sequoia


I had that same issue and was scratching my head over that for days. The fix turns out to be simple though. Make sure you press Control + C and quit the simulator. Once you quit the simulator it starts to actually produce the recording.

like image 27
Harish Avatar answered Sep 21 '22 00:09

Harish