twostraws / ControlRoom

A macOS app to control the Xcode Simulator.
MIT License
5.75k stars 306 forks source link

Record simulator video #94

Closed Volker88 closed 3 years ago

Volker88 commented 4 years ago

Is it possible to add the functionality to record a video from the simulator?

In the terminal it's possible to do it with the following command:

xcrun simctl io booted recordVideo .

To stop the recording in terminal "cartel + c" needs to be clicked

twostraws commented 4 years ago

Hello! Yes, this is totally possible and it's been sitting in my to do list for a long time. Want to give it a try?

Volker88 commented 4 years ago

I can give it a try. But can't promise anything since I never worked with command line tools before.

I saw that some parts of screen recording are already implemented in the controller. I guess I just need to implement it to the user interface and need to figure out how to execute "ctrl + c" to stop the recording afterwards

twostraws commented 4 years ago

Yes: all the other requirements launch the xcrun process and terminate immediately, but this needs to run the process in the background and keep it active until we press Stop.

Volker88 commented 4 years ago

I did now implement it now similar to the function for taking screenshots. but I receive an error when processing the command. Any idea how to troubleshoot it? Also I couldn't find any information about how to terminate it when I press stop.

screen Recording
twostraws commented 4 years ago

I'm not sure about that error because I haven't investigated it, but as I said you will need to run the process in the background and keep it active until we press Stop – this is different from our regular IO commands. Perhaps try to solve the problem in a new, simple macOS command line project so you can get it working without all the Control Room infrastructure?

twostraws commented 3 years ago

This was added in Control Room 2.0, just a couple of days before Xcode 12.5 added it natively 😂