Capture iOS Simulator video for App Preview

本秂侑毒 提交于 2019-11-26 12:18:08

问题


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?


回答1:


For Xcode 8.2 or later

You can take videos and screenshots of Simulator using the xcrun Xcode command-line utility.

  1. Run your app on the simulator.
  2. Open Terminal.app
  3. Run the command

    • To take a screenshot, xcrun simctl io booted screenshot <filename>.<file extension>
    • To take a video, xcrun simctl io booted recordVideo <filename>.<file extension>.

For example screenshot: xcrun simctl io booted screenshot myScreenshot.png
For example video:xcrun simctl io booted recordVideo appVideo.mov

  1. Press ctrl + c to stop recording the video.

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

Xcode 11.2 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.

Now you could use additional flags for video recording:

  • --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.

Now you can record a video in h264 codec, with mask (for non-rectangular displays) and some other flags:

xcrun simctl io booted recordVideo --codec=h264 --mask=black --force appVideo.mov

and for screenshoting:

  • --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".

  • --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. You may also specify a port by UUID

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




回答2:


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 record button.

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

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




回答3:


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.




回答4:


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 the different sizes of iPhone.
  4. Create 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 step 4 to 6 for new sizes.

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




回答5:


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

iPhone Portrait

When you 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 imported the recorded video with the resolution 1080x1920 and rotate it 90 degree. 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




回答6:


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.




回答7:


In macOS Mojave you can record a portion of the screen through the screenshot utility.

  1. Press Shift-Command (⌘)-5 that will pop up a controls panel.
  2. Select .
  3. Select the portion of the screen you want to record - that would be the iPhone simulator.
  4. Click 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.




回答8:


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



回答9:


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 a 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 Handbreak: https://handbrake.fr/downloads.php

And resize the high res video:

  • Drag your high res video to Handbreak
  • Select "Picture Settings" icon
  • Resize to the correct size - close and press "Start" icon - gets saved to desktop



回答10:


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.




回答11:


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.




回答12:


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)



回答13:


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




回答14:


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!




回答15:


I was having the best luck making high quality app store demo movies for IOS using ScreenFlow. I upgraded to 5 so I could record off the device directly, and got a MacBook Air 2. But i first thought I'd try to use the QuickTime capture method and perhaps edit with iMove. Turns out Screen flow is unbeatable if you want to show the user's finger moving across the surface and clicking on things (they can add sound, radar pulses, etc.) For my apps this was very important and creating the necessary transitions and editing to achieve these effects, instead of running the app in the simulator and having ScreenFlow use the cursor motions, was infinitely more work and I gave up quickly.

I have now had great success with both iPad and iPhone apps, including 6+ apps. I have a new 5K iMac so can simulate everything, but all my iPad apps i export from screen flow at 1200x900; I just made iPhone apps at 1080x1920 and had an real problem -- i kept getting the message "Your app video preview couldn't be saved. Try again. If the problem persists, contact us.". I found a great explanation of this here http://blog.eumlab.com/app-video-preview/ but didn't like the "use adobe creative cloud media encoder" to fix it, even if free. So after reading posts on this thread I imported my screen flow 5 mp4 movie which seemed to meet the exact specs required (remember the store was not rejecting my movie, it just never could save it); created a new "app preview movie" project; copied my clip into the "app preview movie" project, and then exported the "new" movie using the built-in pre-sets and a) my 29 second 5 MB mp4 file became a 28 MB file; but b) it imported first time and works fine. Same resolution, same frame rate, same audio encoding, same video encoding -- but now the App Store likes the (now bloated) file and i have my cursor effects. [I had never used iMovie before.] You can see these videos on youtube or in the store. See for example iPad video of French version of a word learning app is at http://youtu.be/L0nBYeK4Pm4; then an iPad app that is a multi-cut of 8 different UI language versions of the app (internationalized for 8 different user L1 languages) is here: http://youtu.be/CjXkAvuBXyQ; and an iPhone 6+ video of an iPhone version of the same app is here: http://youtu.be/36kdLztvc_A. I am adding movies as I add sound files and other iOS 7/8 upgrades to my word learning apps (originally to help me learn to read Chinese words) - which seems a great way for people to know what they are buying.

But of course, if you don't need to show the "finger" and "clicks", or have already mastered such effects in iMovie or others, stick with what you know.




回答16:


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.




回答17:


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.




回答18:


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




回答19:


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.




回答20:


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.It's simple... :)



来源:https://stackoverflow.com/questions/25797990/capture-ios-simulator-video-for-app-preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!