[ios] Take screenshots in the iOS simulator

I want to take a screenshot of my iOS application when it is running in the simulator, and save the screenshot on my Mac. How can I do this?

This question is related to ios iphone xcode ios-simulator screenshot

The answer is


For some reason the commands posted before dont work for me, but this one does:

xcrun simctl io booted screenshot screenshot.png

Running Xcode 9.2


Press ?S or go to File > Save screenshot from your simulator menu and you will get the screenshot saved on your desktop.


Taking Screen Shot in IOS Simulator is SO Simple.

When you Open Simulator In the Right Lift You See File.

Click On File And You See Option Save Screen Shot.

This Option Saves Your Screen Shot In Default Path Which is Desktop.


First, run the app on simulator. Then, use command+s, or File -> Save Screenshot in Simulator to take necessary and appropriate shots. The screenshots will appear on your desktop by default.


on iOS Simulator,

Press Command + control + c or from menu : Edit>Copy Screen

open "Preview" app, Press Command + n or from menu : File> New from clipboard , then you can save command+s

For Retina, activate iOS Simulator then on menu:HardWare>Device>iPhone (Retina) and follow above process

Command + S

is the way to save on Desktop, (on new iPhone simulators, this was introduced in later simulator)


Since Xcode 8.2, you can also save a screenshot with the following command:

xcrun simctl io booted screenshot

Further information in this blog: https://medium.com/@hollanderbart/new-features-in-xcode-8-2-simulator-fc64a4014a5f#.bzuaf5gp0


2020 Latest Update: XCode 11.4

Click on the camera icon above simulator to capture screenshot and save to your camera roll

enter image description here

Another option: File > Save Screen from simulator


  1. Focus simulator
  2. Go to menu File->Save Screen Shot

    or

    Press ?+S

Screen shot saves in desktop


Press Command+Shift+4 and then keep the mouse pointer on Simulator and then press "Space Bar" key one camera icon will appear, now left click the mouse. Your simulator screen shot is saved on desktop. You can take the screen shot any small screen in the same way.


Simple answer with sample answer ;-)

on iOS Simulator,

Press Command + control + c or from menu : Edit>Copy Screen

enter image description here

open "Preview" app, Press Command + n or from menu : File> New from clipboard , then you can save Command + s

UnCheck Alpha

enter image description here

You can change Image dimension to your requirement.

enter image description here

Here is the Final Image,For example

enter image description here


First method:

Select simulator and press "command + s" button. Screenshot saved on desktop.

Second method:

Select simulator and go to "File > New Screenshot". Screenshot saved on desktop.


You can google for IOS Simulator Cropper software useful for capturing screen shots and also easy to use with various options of taking snapshots like with simulator/without simulator.

Update Just pressing CMD + S will give you screenshot saved on desktop. Pretty easy huh..


Screenshot with device frame

Step - 1 Open quick time player

Step - 2 Tap new screen recording

enter image description here

Step - 3 Select Capture selected window enter image description here

Step - 4 Cursor point on the simulator. It will automatically select the whole simulator like enter image description here

Step - 5 Screenshot will open using preview. save it.

Here is some sample screenshot

enter image description here enter image description here


An update with Xcode 11.4 simulator

To capture a screen shot, click on 'Camera' icon/action button, on the top bar of simulator.

enter image description here

OR

Select Save Screen Shot menu item, from File menu.

File => Save Screen Shot


Use ? + S to capture a screen shot.
(Use window + s, if you are using windows/non-apple keyboard).

enter image description here

See for more details: How to change simulator scale options with Xcode 9+.


Tip 1: How do you get screen shot with 100% (a scale with actual device size) that can be uploaded on AppStore?

Disable Optimize Rendering for Window scale from Debug menu, before you take a screen shot.

Here is an option

Menubar ? Debug ? Disable "Optimize Rendering for Window scale"

enter image description here


Tip 2: Where is screen shot saved (Default Path)? How to change default path?

Simulator saves screen shot file on (logged-in user's) desktop and it's default path.

To change default path (with Xcode 9+), press and hold ? Option (alt) button from keyboard, while you take a screen shot.
Or
Using Mac Keyboad: Press keys ? Option + ? + s all together.
It will show to a dialog with file storage options and also allows to set/change default path.

enter image description here


Tip 3: How to take a screen shot with Device Bezel?

Enable Show Device Bezel from Window menu.

Here is an option

Menubar ? Window ? Enable "Show Device Bezel"

enter image description here

Now,

  1. Press ? + shift + 4 + Spacebar, all together in Mac Keyboard. (A window snap capture mode will become active)
  2. Select Simulator window/frame, that you want to capture. It will save screenshot with device bezel (with shadow effect in background) on (logged-in user's) desktop.

You can also remove the Simulator toolbar as described here.


In OSX Captain its a bug to take screenshot of simulator. You have to Update your OSX Sierra first then your are able to take. while taking in OSX Captain use terminal command which is xcrun simctl io booted screenshot.

before running this command u have to select desktop in terminal like:

"cd desktop" then run that command. Happy Coding!!!


For people using Xcode 11.4, to get rid of the simulator top bar, this is far from ideal but you can disable shadows for the screenshot application in a terminal with the following command :

$ defaults write com.apple.screencapture disable-shadow -bool TRUE; killall SystemUIServer

Then, you can use ? + ? + 4 and select the simulator to take a screenshot. Without the shadow, you can easily crop the top bar with the preview app. To re-enable the shadow for the screenshot application :

$ defaults write com.apple.screencapture disable-shadow -bool FALSE; killall SystemUIServer

Source of this answer here.


Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to iphone

Detect if the device is iPhone X Xcode 8 shows error that provisioning profile doesn't include signing certificate Access files in /var/mobile/Containers/Data/Application without jailbreaking iPhone Certificate has either expired or has been revoked Missing Compliance in Status when I add built for internal testing in Test Flight.How to solve? cordova run with ios error .. Error code 65 for command: xcodebuild with args: "Could not find Developer Disk Image" Reason: no suitable image found iPad Multitasking support requires these orientations How to insert new cell into UITableView in Swift

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code

Examples related to ios-simulator

The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 flutter run: No connected devices Error Running React Native App From Terminal (iOS) How to uninstall downloaded Xcode simulator? Capture iOS Simulator video for App Preview iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development How to enable native resolution for apps on iPhone 6 and 6 Plus? How to access iOS simulator camera Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." Document directory path of Xcode Device Simulator

Examples related to screenshot

How to make a movie out of images in python Unable to capture screenshot. Prevented by security policy. Galaxy S6. Android 6.0 How to prevent Screen Capture in Android Using ADB to capture the screen How to save the contents of a div as a image? How to capture the screenshot of a specific element rather than entire page using Selenium Webdriver? iOS Detection of Screenshot? Take a full page screenshot with Firefox on the command-line Screenshot sizes for publishing android app on Google Play Take screenshots in the iOS simulator