You can take a screenshot or record a video of the simulator window using the xcrun command-line utility. To record a video, execute the following command

xcrun simctl io booted recordVideo <filename>.<file extension>.

For example:

xcrun simctl io booted recordVideo appvideo.mov

Press control + c to stop recording the video. The default location for the created file is the current directory.