499

Okay, so we can now submit video previews of our apps on the App Store. According to Apple we should do so with an iOS8 device and OSX 10.10. The problem is you have to have all the different devices (4", 4.7", 5.5" and iPad).

Is there an alternative to this?

I am thinking of capturing a video of the simulator. The problem is the device screen is bigger than my FullHD monitor when shown in 100% resolution. Any solution that can capture a video right from the simulator in full resolution?

Edit: Since a lot of people are answering questions I'm not asking let me say: - Recording one device size and scaling it is not what I'm asking; - How to record any app preview is not what I'm asking; - How you do your previews is not what I'm asking;

What I am asking is can you record a video from the simulator in 100% resolution if it doesn't fit on the screen?

AXE
  • 8,335
  • 6
  • 25
  • 32
  • THANKFULLY Xcode made this easy as of late. See [this response](https://stackoverflow.com/a/66075167/13102348) by @atalayasa. – Eric May 18 '21 at 01:47
  • 3
    With Xcode 12 just press cmd + R in the simulator to record the screen. cmd + S to take a screenshot. – Mikkel Cortnum May 25 '21 at 13:30

25 Answers25

882

For Xcode 8.2 or later

You can take videos and screenshots of Simulator using the xcrun simctl, a command-line utility to control the Simulator

  1. Run your app on the simulator

  2. Open a terminal

  3. Run the command

    • To take a screenshot

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

      For example:

      xcrun simctl io booted screenshot myScreenshot.png

    • To take a video

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

      For example:

      xcrun simctl io booted recordVideo appVideo.mov

  4. Press ctrl + C to stop recording the video.

The default location for the created file is the current directory.

Xcode 11.2 and later gives extra options.

From Xcode 11.2 Beta Release Notes

simctl video recording now produces smaller video files, supports HEIC compression, and takes advantage of hardware encoding support where available. In addition, the ability to record video on iOS 13, tvOS 13, and watchOS 6 devices has been restored.

You could use additional flags:

xcrun simctl io --help
Set up a device IO operation.
Usage: simctl io <device> <operation> <arguments>

...

    recordVideo [--codec=<codec>] [--display=<display>] [--mask=<policy>] [--force] <file or url>
        Records the display to a QuickTime movie at the specified file or url.
        --codec      Specifies the codec type: "h264" or "hevc". Default is "hevc".

        --display    iOS: supports "internal" or "external". Default is "internal".
                     tvOS: supports only "external"
                     watchOS: supports only "internal"

        --mask       For non-rectangular displays, handle the mask by policy:
                     ignored: The mask is ignored and the unmasked framebuffer is saved.
                     alpha: Not supported, but retained for compatibility; the mask is rendered black.
                     black: The mask is rendered black.

        --force      Force the output file to be written to, even if the file already exists.

    screenshot [--type=<type>] [--display=<display>] [--mask=<policy>] <file or url>
        Saves a screenshot as a PNG to the specified file or url(use "-" for stdout).
        --type       Can be "png", "tiff", "bmp", "gif", "jpeg". Default is png.

        --display    iOS: supports "internal" or "external". Default is "internal".
                     tvOS: supports only "external"
                     watchOS: supports only "internal"

                     You may also specify a port by UUID
        --mask       For non-rectangular displays, handle the mask by policy:
                     ignored: The mask is ignored and the unmasked framebuffer is saved.
                     alpha: The mask is used as premultiplied alpha.
                     black: The mask is rendered black.

Now you can take a screenshot in jpeg, with mask (for non-rectangular displays) and some other flags:

xcrun simctl io booted screenshot --type=jpeg --mask=black screenshot.jpeg

shim
  • 9,289
  • 12
  • 69
  • 108
Tikhonov Aleksandr
  • 13,945
  • 6
  • 39
  • 53
  • 4
    Sounds just like what I need. Unfortunately it's crashing on my computer with: "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to create metal device for video writer.'" Google knows nothing of this problem. Any ideas? – AXE Dec 14 '16 at 21:26
  • 5
    I got “Failed to create metal device for video writer” too. I guess that’s because our Macs are too old to run Metal! Going by the error message, it’s using the Metal graphics API to capture the output of the simulator, and Metal only runs on Macs >2012: http://www.imore.com/here-are-macs-work-os-x-el-capitans-metal – andrewf Jan 16 '17 at 16:14
  • this is not completely working, Answer needs some more explanation – Kirtikumar A. Feb 08 '17 at 18:41
  • 3
    Worked perfectly on my 2015 MacBook Pro running 10.12.4 I'd just add that pressing Ctrl-C in Terminal stops recording and that I haven't actually tried submitting to iTunesConnect yet! But looking good. – Stephen Watson Apr 13 '17 at 11:02
  • Works perfectly in iOS 10.x Xcode 8.X, but note you need to download the command line tools + you need to make sure xcode is configured to reference them. see https://stackoverflow.com/questions/29108172/xcrun-unable-to-find-simctl SO question too – user3069232 Jun 01 '17 at 18:37
  • 2
    From Apples documentation: Note: Recording a video with Simulator requires a Mac computer and a version of macOS that supports the Metal framework. For a list of Mac computers that support metal, see https://support.apple.com/en-us/HT205073. – vilmoskörte Jun 24 '17 at 09:59
  • 2
    To finish the video, just use `cmd + c` – nefarianblack Jul 21 '17 at 20:55
  • 1
    This saved my butt for making an iPad12.9 preview vid. Thanks!! One note...when I uploaded the preview created in iMovie, the audio format was rejected. The fix was to add any audio -- a song etc -- then share as a preview...then delete the audio and share again. The original mystery channel was deleted and it uploaded fine to iTunes Connect. Once again. Thanks, man!! – Mike Critchley Aug 15 '17 at 11:46
  • 25
    Is it possible to show touches on video with `xcrun`? – kelin Sep 09 '17 at 02:33
  • 1
    it is a bit slow on my brand new MacBook Pro, only 14fps – Tibidabo Sep 27 '17 at 02:33
  • 3
    It's is possible to capture de audio app too? – Haroldo Gondim Nov 03 '17 at 22:21
  • To answer the FullHD question: an iPhone Plus has to be recorded, it'll produce Videos with a resolution of 1242 × 2208. Capturing a normal iPhone would produce too small videos. Another non-obvious point: the videos are captured at full resolution, regardless of the Simulator's window size. – Karsten Nov 19 '17 at 15:16
  • 3
    This does not appear to capture audio. – olynoise Jan 26 '18 at 18:59
  • 3
    Have any of you guys got any workarounds for adding audio to your video? – Jules Feb 08 '18 at 06:51
  • 27
    This is giving me poor video quality. – Kashif Mar 25 '18 at 16:38
  • This works for me, but it's full of compression artifacts and has no sound. – David Dunham May 06 '18 at 21:39
  • Using this solution on my 2013 MacBook Pro the Simulator gets very slow which make the videos are unusable. :( – Daniel May 18 '18 at 12:02
  • 1
    I've had this work in the past, but for some reason I am getting videos that are **0 bytes** in size. Maybe having multiple versions of Xcode installed has anything to do? I am using latest Xcode, official and the associated simulator... – Nicolas Miari Jun 28 '18 at 10:21
  • 1
    If you get "xcrun: error: unable to find utility "simctl", not a developer tool or in PATH", Then just open XCode and go to Preferences -> Locations and set a value in "Command Line Tools" – Johan Franzén Dec 18 '18 at 09:28
  • 1
    @NicolasMiari, I've just had to same zero-size file problem. Rebooting my computer solved the issue. – Arda Feb 06 '19 at 08:00
  • Audio workaround: Capture the audio on an actual device you have, and then overlay it onto the video captured from the simulator for the device you don't have. You may need to automate any interaction with your app for the sections you record, so that the sounds you capture on the actual device match the video you capture from the simulator. – Arda Feb 06 '19 at 08:11
  • 9
    My video had bad quality using the above command. Specifying mp4 fixed the issue for me: `xcrun simctl io booted recordVideo --type=mp4 .mp4` – Andy Novak Mar 02 '19 at 21:50
  • The video resolution is wrong if I try to capture iPhone XS video. There are two big black bars at the sides of the video. – Blip May 13 '19 at 18:40
  • How to capture touches using this method? – kelin Jul 19 '19 at 09:35
  • The video recorded in this way is not getting played in VLC Player. Also, if you share it with windows machine, it cant play on windows machine too. Anyone knows, why this thing happens? – Mehul Thakkar Jul 25 '19 at 06:55
  • What if you're running multiple Simulators simultaneously, how'd you know to specify which simulator to record? – Adro Aug 09 '19 at 02:56
  • @AndyNovak what is the path to video file that i should put on? – MD Sazid Hasan Dip Sep 15 '19 at 18:35
  • I had surprisingly great results with this method. Thank you very much. Also nice that we got Metal acceleration in the simulator this year. – Clément Cardonnel Oct 16 '19 at 13:42
  • 17
    Frame rate was very low when recording with default settings on 2013 MacBook Pro. Specifying `--codec=h264` solved the issue and resulted in smooth video. – Jeffrey Fulton Feb 12 '20 at 16:40
  • 1
    `--display=external` fix recording of `Apple TV Simulator`. Thanks a lot – ArtFeel Apr 27 '20 at 17:54
  • 9
    Capturing in h264 format gave me a much higher framerate. `xcrun simctl io booted recordVideo --codec=h264 capture.mp4` – Bijoy Thangaraj Jun 04 '20 at 04:21
  • How we can recored sound and video together? – ios coder Nov 05 '20 at 19:47
258

Using xcrun simctl:

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


Using Screen Capture:

Use cmd + shift + 5 and the resize the selection so that the simulator is recorded.


Using QuickTime Player:

You can use QuickTime Player to record the screen.

  • Open QuickTime Player
  • Select File from the menu
  • Select New Screen recording

Now from the Screen Recording window, click on the record button.

It will provide you with an option to record the entire screen or a selected portion of your screen.

You will have to make a selection of your simulator so that only the simulator portion will be recorded.

Kalpesh
  • 4,020
  • 4
  • 18
  • 27
  • 24
    THIS is the only correct answer to the question. All other answers ask you to use a device. – KPM May 27 '16 at 08:54
  • 1
    Does this also work when using an iOS simulator that is bigger than the actual screen (say, iPad Pro 12.7")? – DrMickeyLauer Sep 20 '16 at 15:13
  • 8
    This won't won't work if your simulator size is bigger than your screen. You can record the entire screen of your mac or a selected portion of your screen. – Kalpesh Sep 21 '16 at 07:38
  • 8
    This works but you'll see the mouse pointing on the simulator. It could be useful for testing purposes, but not for marketing campaigns videos. – Alan Andrade Nov 14 '16 at 20:04
  • You can use [Cursorcerer](http://doomlaser.com/cursorcerer-hide-your-cursor-at-will/) to hide the mouse cursor while you record the screen with QuickTime. – user47712 Mar 08 '17 at 13:00
  • 5
    And how to stop recording? :S – Tony Jun 26 '19 at 07:52
  • 1
    @Tony you have probably already figured this, but sending SIGINT will do it, so `killall -INT simctl` will work by sending the INT signal to all running simctl processes, causing them to stop the recording and write out the file without corruption – Mike Hardy Oct 11 '21 at 00:30
  • A little tip that might not be so obvious - to stop the QuickTime Player/recording, press `control` + `command` + `esc`. When you start recording after cropping out the monitor, the recording options disappear. [More info from apple here](https://support.apple.com/en-ke/HT208721). – Vicktor Apr 10 '23 at 08:24
81

You can record a portion of the screen with built-in screenshot utility:

  1. Press Shift-Command-5 to show a control panel.
  2. Select enter image description here.
  3. Select a portion of the screen you want to record. That would be the iPhone simulator.
  4. Click enter image description here to stop recording.
  5. A thumbnail will appear at the bottom right corner of the screen. You can edit it before saving.

If you want to visualize mouse clicks, after step 1 select Options control and enable Show Mouse Clicks.

Vadim Bulavin
  • 3,697
  • 25
  • 19
76

Apple recommends doing so on an actual device and has a guide on how to do this using QuickTime and iMovie on iOS and OS X: https://developer.apple.com/app-store/app-previews/imovie/Creating-App-Previews-with-iMovie.pdf

Summary:

Capture Screen Recordings with QuickTime Player

  1. Connect your iOS device to your Mac using a Lightning cable.
  2. Open QuickTime Player.
  3. Choose File > New Movie Recording.
  4. In the window that appears, select your iOS device as the Camera and Microphone input source.

Create an App Preview with iMovie

Import Screen Recordings

Next, you import the screen recording files that you captured with QuickTime Player into iMovie. In iMovie:

  1. Choose File > Import Media.
  2. In the window that appears, select the screen recording files.

Create an App Preview Project

To start a new app preview project, choose File > New App Preview. A timeline appears where you can add and arrange clips to create your preview.

auspicious99
  • 3,902
  • 1
  • 44
  • 58
ali-hk
  • 905
  • 7
  • 6
  • 1
    System Requirements: • iOS device with Lightning connector, Retina display, and iOS 8. • Mac with OS X Yosemite. • iMovie for Mac version 10.0.6 or later. And iMovie is not free. – Borzh Jan 23 '15 at 17:38
  • 36
    This is a good answer except that it is NOT capturing video from the Simulator (only from an actual device.) – race_carr Aug 12 '15 at 18:10
  • 1
    screen recording can now get almost 60fps while appstore accepts just 30 fps which makes this not usable everytime – PetrV Aug 25 '15 at 21:08
  • 12
    I do not have all different kind of devices – János Sep 29 '15 at 02:18
  • Question is about the simulator. – Steve Ives Oct 12 '16 at 06:45
  • See my [answer](http://stackoverflow.com/a/41141801/3785970) for XCode 8.2 – Tikhonov Aleksandr Dec 14 '16 at 11:57
  • 1
    @PetrV I struggled with iMovie wanting to export everything at 60fps forEVER... Turns out you can bring the big iMovie 60fps video back into Quicktime and EXPORT from Quicktime as for iPad2, which drops the frame rate and gets the video happy for iTunesConnect. Totally jenky, but I'm so done with fiddling with this and it worked. – Dave Levy Jun 21 '17 at 21:06
  • Good idea, but for marketing videos I maybe want test content displayed in my app and on my actual phone the app shows content that I don't want in my marketing material. Also I don't want to erase app data from my physical device every time I create a video. – randomcontrol Oct 20 '19 at 10:23
66

I'm actually surprised no one provided my answer. This is what you do (this will work if you have at least 1 eligible device):

  1. Record, edit and finish the App Preview with the device you have.
  2. Export as a file.
  3. Go to your Simulators and print screen 1 shot on each of the different sizes of iPhones.
  4. Create a new App Preview in iMovie.
  5. Insert the screenshot of the desired size FIRST, then add the file of the App Preview you've already made.
  6. Export using Share -> App Preview
  7. Repeat steps 4 to 6 for new sizes.

You should be able to get your App Preview in the desired resolution.

auspicious99
  • 3,902
  • 1
  • 44
  • 58
Eric Chuang
  • 1,017
  • 9
  • 28
  • 8
    Eric, you're a genius. This works perfectly! I had to make sure to take my simulator screenshots at 100% screen size too. – Swindler Nov 22 '15 at 07:08
  • 2
    Eric, great answer. Thank you very much! – Dominique Vial Jan 05 '16 at 15:33
  • Sometimes you might want to create one for iPad as 900x1200, and then use this command to turn it into iPhone resolution, with empty bars at top and bottom: `ffmpeg -i appPrevw_ipad.mp4 -vf scale=1080:-1,pad=1080:1920:0:200:white appPrevw_iphone.mp4`. 200 is the vertical placement of the (shorter) iPad content. You can take this as a base and add more stuff at the empty bars. – ishahak Dec 01 '16 at 13:36
  • 2
    This is the best solution. – CodyMace Dec 27 '16 at 23:51
  • lol aspect ratio of iphone plus/normal is different from X so it doesnt work and we its not a good idea to crop the video either – Reza.Ab May 30 '18 at 03:33
  • do note i answered this before the iPhone X was even out – Eric Chuang Nov 30 '18 at 08:03
  • Eric - any solution now? I only have an iPhone X, and when I use a 5.5" display screenshot (eg: the iPhone 8 Plus) the resulting video has black bars on the side... – MihaiL Jan 16 '20 at 08:53
58

Using the new release of Xcode 12.5 you can simply record the simulator screen using ⌘ + R. For details you can visit here.

auspicious99
  • 3,902
  • 1
  • 44
  • 58
atalayasa
  • 3,310
  • 25
  • 42
  • 1
    Yes, but the record video without sound. How could we fix it? – Zhou Haibo Jun 09 '21 at 07:44
  • Resulted video (at least for using iPhone 11 Pro Max for 6.5) is not accurate. Trying to upload 'as is' will result in a size error. The output video if a few pixels off and need to be adjusted. This cannot be done with Quicktime (adjust resolution). – bauerMusic Jun 19 '21 at 17:01
  • You can make App Previews with iMovie. It's really annoying that it doesn't record it in the correct resolution, but you can fix it somewhat easily with iMovie. – Mikkel Cortnum Jan 31 '23 at 16:05
32

You should use QuickTime in Yosemite to connect and record the screen of your iOS devices.

iPhone Portrait

When you have finished the recording, you can use iMovie to edit the video. When you're working on an iPhone Portrait App Preview, the resolution must be 1080x1920 but iMovie can only export in 16:9 (1920x1080).

One solution would be to import the recorded video with the resolution 1080x1920 and rotate it 90 degrees. Then export the movie at 1920x1080 and rotate the exported video back 90 degrees using ffmpeg and the following command

ffmpeg -i Landscape.mp4 -vf "transpose=1" Portrait.mp4

iPad

The iPad is a little bit trickier because it requires a resolution of 1200x900 (4:3) but iMovie only exports in 16:9.

Here is what I've done.

  1. Record the movie on iPad Air in Landscape (1200x900, 4:3)

  2. Import into iMovie and export as 1920x1080, 16:9 (iPadLandscape16_9-1920x1080.mp4)

  3. Remove left and right black bars to a video with 1440x1080. The width of one bar is 240

     ffmpeg -i iPadLandscape16_9-1920x1080.mp4 -filter:v "crop=1440:1080:240:0" -c:a copy iPadLandscape4_3-1440x1080.mp4
    
  4. Scale down movie to 1220x900

     ffmpeg -i iPadLandscape4_3-1440x1080.mp4 -filter:v scale=1200:-1 -c:a copy iPadLandscape4_3-1200x900.mp4
    

Taken from my answer on the Apple Developer Forum

auspicious99
  • 3,902
  • 1
  • 44
  • 58
brutella
  • 1,597
  • 13
  • 26
  • 2
    This is clever, but re-encoding using ffmpeg degrades the video quality way too much to the point that it is not usable. – RawMean Sep 21 '14 at 22:07
  • How do I set export to 1080x1920? I can't find this dimensions in iMove! – Mariam Nov 20 '14 at 19:51
  • @Mariam You cannot export in 1080x1920. iMovie can only export in 16:9 (1920x1080). – brutella Nov 24 '14 at 09:39
  • 15
    This doesn't answer the question. – Tim Chen Apr 02 '15 at 09:42
  • I found you can install the Handbrake app on OS X, it allows downscaling to any dimension you desire. Then to support Apple requirements you can import the result into Quicktime and save it using an Apple codec and it will end up in the size of the input file. As a side note, Handbrake can encode to amazingly compact mp4 video files, re-encoding using an Apple encoder resulted in 10 times the size. I would assume ffmpeg in the example above by brutella will accomplish the same end result but pay attention Apple can be picky about what codec you used to produce the resulting video. – Gunnar Forsgren - Mobimation Dec 29 '15 at 20:57
27

Taking a Screenshot or Recording a Video Using the Command Line

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

  1. Launch your app in Simulator.

  2. Launch Terminal (located in /Applications/Utilities), and enter the appropriate command:

    • To take a screenshot, use the screenshot operation:

      xcrun simctl io booted screenshot
      

      You can specify an optional filename at the end of the command.

    • To record a video, use the recordVideo operation:

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

      To stop recording, press Control-C in Terminal.

      Note: You must specify a filename for recordVideo.

    The default location for the created file is the current directory.

    For more information on simctl, run this command in Terminal:

    xcrun simctl help
    

    For more information on the io subcommand of simctl, run this command:

    xcrun simctl io help
    

From Apple Documentation.

Pang
  • 9,564
  • 146
  • 81
  • 122
Shady Mostafa
  • 815
  • 10
  • 15
  • 4
    Bu no audio produced :( – Jules Feb 07 '18 at 13:50
  • 4
    The Apple Documentation link wasn't very specific/helpful. I had to search around before finding that the video file extensions you can use are `h264`, `mp4` or `fmp4`. Example: `xcrun simctl io booted recordVideo test-video-recording.mp4`. Also, to end the video I had to end the terminal process with `control` + `c`. – Trev14 Jan 29 '19 at 13:35
  • This solution worked but it does not recording audio from simulator – duyhungws Apr 15 '20 at 04:01
27

As of Xcode 13, you can directly start screen recording from the simulator in full resolution :

1. enter image description here

  1. Or Press Command + R

Press escape or the recording button to stop the recording

The recorded video is in the device resolution, so it has to be resized to the App Store Preview resolutions (886x1920, 1080x1920, 1600x120 etc) The aspect ratio of the iPhone 6.5 Inch is not exactly the same as the required App Store preview resolution so makes sure it is 886x1920 or 1920x886 when you export it.

Tibidabo
  • 21,461
  • 5
  • 90
  • 86
22

You can do this for free with the following tools. You will need at least one real device (I used an iPhone 5).

Capture the video with the simple, but excellent appshow (note this is a very barebones tool, but it's very easy to learn). This will export at the native device resolution (640x1136).

Resize with ffmpeg. Due to rounding, you can go directly between the resolutions, but you have to oversize and then crop.

ffmpeg -i video.mov -filter:v scale=1084:1924 -c:a copy video_1084.mov
ffmpeg -i video_1084.mov -filter:v "crop=1080:1920:0:0" -c:a copy video_1080.mov

For iPad, you can crop and then add a letterbox. However, cropping like this usually won't yield a video that looks exactly like your app does on the iPad. YMMV.

ffmpeg -i video.mov -filter:v "crop=640:960:0:0" -c:a copy video_640_960.mo
ffmpeg -i video_640_960.mov -filter:v "pad=768:1024:64:32" -c:a copy video_768_1024.mov
ffmpeg -i video_768_1024.mov -filter:v scale=900:1200 -c:a copy video_900_1200.mov
auspicious99
  • 3,902
  • 1
  • 44
  • 58
vish
  • 2,436
  • 1
  • 24
  • 20
  • Omg, you saved a lot of time for me. Thank you so much. – Dinesh Raja Mar 18 '15 at 18:58
  • Can you help me to resize 640*1136 video to 750*1334 resolution? – Dinesh Raja Mar 18 '15 at 19:26
  • 1
    For iphone 6+ the commands are `ffmpeg -i source.mov -filter:v scale=1246:2216 -c:a copy intermediate.mov` and `ffmpeg -i intermediate.mov -filter:v "crop=1242:2208:0:0" -c:a copy final.mov` – Daniel K May 09 '15 at 06:08
  • @vish @daniel On my machine, these outputs can't be opened in QuickTime and won't upload to iTunes Connect. They do open in VLC though. I've tried `-pix_fmt yuv420p` and `-vcodec lib264x` with no luck... – nathan May 16 '15 at 09:34
  • @ntesler, unfortunately I'm not sure what the problem is there, but I can tell you that I was able to open in quicktime and upload to itunesconnect with these exact commands. I installed ffmpeg with homebrew and it has version `ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers` – vish May 16 '15 at 17:05
21

This is the way I found easiest and you only need one iPhone and iPad:

Record device screen with QuickTime Player:

  • Connect your device.
  • Open QuickTime Player.
  • Choose File > New Movie Recording (CMD + alt + N)
  • In the window that appears, select your iOS device as the camera with maximum resolution.
  • Save video file (CMD + S)

Open iMovie

  • Select File -> New App Preview
  • Drag an IMAGE from your app with the biggest resolution ex. a 1920 x 1080 screenshot to the project. (This makes the video 1920 x 1080 even if you recorded with an iPhone 5)
  • Drag the movie you recorded to the project.
  • Save by choosing File -> Share -> App Preview

Now do this with all of your devices or:

Download Handbrake: https://handbrake.fr/downloads.php

And resize the high res video:

  • Drag your high res video to Handbrake
  • Select the "Picture Settings" icon
  • Resize to the correct size - close and press "Start" icon - gets saved to the desktop
auspicious99
  • 3,902
  • 1
  • 44
  • 58
sold
  • 314
  • 1
  • 3
  • 11
21

The Apple's Simulator User Guide states in Taking a Screenshot or Recording a Video Using the Command Line paragraph:

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


To record a video, use the recordVideo operation in your Terminal:

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

Note that the file will be created in the current directory of your Terminal.


If you want to save the video file in your Desktop folder, use the following command:

xcrun simctl io booted recordVideo ~/Desktop/<filename>.<extension>

To stop recording, press Control-C in Terminal.

Imanou Petit
  • 89,880
  • 29
  • 256
  • 218
  • 8
    My videos always came out corrupted. When viewed the video would go green and pixelated. The time before that, iMovie failed to export it. – toast Feb 01 '17 at 05:15
6

With Xcode 12 just press cmd + R in the simulator to record the screen. cmd + S to take a screenshot.

Mikkel Cortnum
  • 481
  • 4
  • 11
5

From Xcode 9 and on you can take screenshot or record Video using simctl binary that you can find it here:

/Applications/Xcode.app/Contents/Developer/usr/bin/simctl

You can use it with xcrun to command the simulator in the command line.

  1. For taking screenshot run this in command line:

    xcrun simctl io booted screenshot
    
  2. For recording video on the simulator using command line:

    xcrun simctl io booted recordVideo fileName.videoType(e.g mp4/mov)
    

Note: You can use this command in any directory of your choice. The file will be saved in that directory.

Rawand Saeed
  • 795
  • 10
  • 13
5

As of today in 2019, Apple has made life much easier for low budget or one-man project developers like me. You can just use the terminal command from one of the above posts to record videos from the wanted device simulator. And then use iMovie's New App Preview feature.

xcrun /Applications/Xcode.app/Contents/Developer/usr/bin/simctl io booted recordVideo pro3new.mov

iMovie -> File -> New App Preview

William Tong
  • 479
  • 7
  • 14
3

Here is a solution that works and doesn't cost $300 (FinalCut Pro), but it does require ScreenFlow (ScreenFlow app in AppStore) ($100):

  • Hookup your device to a Mac running Yosemite
  • Launch Quicktime and select File/Newi Movie Recording
  • Launch ScreenFlow and capture your video
  • Edit your video inside ScreenFlow (add text, music, etc)
  • Crop the video so that it only contains the device screen
  • Export the video with the size required by Apple (e.g., 1334x750)
RawMean
  • 8,374
  • 6
  • 55
  • 82
  • I think this is the only solution for recording the app previews without having all the devices, but what a pity Apple didn't make this easier by capturing videos directly from the simulator (like screenshots) – Macistador Oct 20 '14 at 11:52
  • Not sure if it applies to movies captured with ScreenFlow but I imported a client movie they had recorded at 1330x750 that was only 9MB. They recorded it using Quicktime but had managed to get it at 60fps instead of the 30fps max allowed. I re-exported with ScreenFlow and it blew out to 600MB! I then put the original on a Yosemite machine and used Apple's instructions https://developer.apple.com/app-store/app-previews/imovie/Creating-App-Previews-with-iMovie.pdf was able to export a preview, now 14MB. I have no idea why a movie that started as 9MB ends up 50% bigger at half the frame rate. – Andy Dent Dec 16 '14 at 07:54
3

The best tool I have found is Appshow. Visit http://www.techsmith.com/techsmith-appshow.html (I do not work for them)

bakwarte
  • 317
  • 1
  • 2
  • 10
3

A tip for users who like to use ZSH functions. You can simplify things a little by adding a function that does the same thing as @Tikhonov Alexander's answer.

Start out by typing:

edit ~/.zshrc

into your terminal.

Then add this function someplace in the file.

function recsim() {
    echo -n "Use CTRL+C to stop recording";
    xcrun simctl io booted recordVideo --codec=h264 --mask=black "$1.mp4";
}

To use, type something like:

recsim appPreview

into your terminal window. Note: Terminal must be restarted after adding the function before it will work.

This function is adapted from Antoine Van Der Lee's blog post on how to do this in bash, which can be found here.

D. Pratt
  • 444
  • 8
  • 15
  • Note: if one doesn't want to pre-specify the extension, simply change the `xcrun` line's part in quotes to `"$1"` - then specify the entire file name on the command line: `recsim appPreview.mp4` – leanne Dec 21 '19 at 19:01
2

For Apple TV Simulator (tvOS, AppleTV) you should add --display=external parameter. I use this to save to desktop:

xcrun simctl io booted recordVideo --display=external --codec=h264 --force ~/Desktop/SimulatorVideo.mov

--force to rewrite if file exist
--codec to higher framerate

Nike Kov
  • 12,630
  • 8
  • 75
  • 122
2

I've created RocketSim for this reason. It comes with a UI to start the recording and converts the recording into the right format requirements for App Previews.

You can simply drag the recording into App Store Connect and it simply works. An example of this can be found here.

Antoine
  • 23,526
  • 11
  • 88
  • 94
1

You can use the QuickTime screen recording and the iOS Simulators to do your video recordings. The tricky thing here is to get the correct size so that iMovie can detect the output resolution when you go to export the AppPreview. I haven't found a way to select the output res in iMovie so if must detected by the format of the media you are using. It may take you several tries but it's doable. It's one of those: do I have $300 for FinalCut Pro or do I have an hour or so of my time? You only need three recordings as mentioned above. I could actually do two of them on devices because I have them but I don't have an iPhone 6 (yet ... :) ). I also like the simulators because you can use something like SimFinger to simulate gestures and pressing of buttons.

Good luck!

Phantom59
  • 947
  • 1
  • 8
  • 19
  • 1
    I want to also mention that there are some limitations in using the simulators. For example, you have to pick one that fits on the screen. And this may not always be suitable for your needs. In my case, the features that I wanted to highlight are in landscape mode; so that worked out great because some of the simulators don't fit in portrait mode on my MacBook Air. Make sure that the scale of the simulator is set to 100%. – Phantom59 Dec 07 '14 at 17:18
  • 1
    Yes, it is very irritating that some simulators don't fit on the screen even at max Zoom Out! – AXE Dec 08 '14 at 17:44
1

I was facing the same problem. It has a very simple solution that worked for me. Just follow these steps:

1.Make a preview video in iMovie.

2.Export video using share file option. Choose 1920x1080 as it can be used for 5S, and 6 plus.

3.Download Appshow for Mac by techsmith (https://www.techsmith.com/techsmith-appshow.html.) It is specially made for making app preview videos. But i don't recommend it for making videos but rather just for exporting.

4.Choose a new App Preview video and customise it by choosing fewer frames which you can later delete.

5.Import your iMovie video into this template. On the top right corner you can choose any resolution you want, appshow has all the resolutions required for app preview.

6.Finally, just choose the device and export the video in your selected resolution.

shalz
  • 11
  • 1
1

In my MBP's Settings > Displays > Display, I see a setting for 'Resolution: Default for Display / Scaled'. I set it to 'More space', then try the various simulators, all of which seem to fit on the enlarged screen at 100%. I suspect that wouldn't work with your FullHD screen though...

An alternative might be to try to install some sort of VNC server solution on the simulator, like https://github.com/wingify/vnc, and record that with a VNC recorder - I believe there's a Python VNC recorder out there.

android.weasel
  • 3,343
  • 1
  • 30
  • 41
0

Unfortunately, the iOS Simulator app does not support saving videos. The easiest thing to do is use Quicktime Player to make a screen recording. Of course, you'll see the mouse interacting with it which is not what you want, but I don't have a better option for you at this time.

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
0

You can combine QuickTime Player + iMovie(Free)

At first choose your desired simulator from xcode and record screen using QuickTime Player. After that use iMovie for making App Preview and finally upload the video with Safari browser.**enter image description here**It's simple... :)

rafana
  • 66
  • 6