2

In Xcode 6 Apple added simctl which allows to do a lot with the iOS simulator, but there is no option to take screenshots. There are 2 alternatives, less comfortable:

  1. Using instruments and *.js scripts - UIAutomation.
  2. Using osascript as mentioned in: http://jehiah.cz/a/iphone-simulator-screenshot.

Looking for a simple way like xcrun simctl screenshot

Ron D.
  • 3,774
  • 6
  • 31
  • 39

3 Answers3

1

Sorry, this is not exposed via CoreSimulator. The only way you can get the screenshot is by interacting with iOS Simulator.app. Please file a bug report requesting this feature at http://bugreport.apple.com

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

Using OSAScript is the most direct way to do this if you don't want to completely automate your iOS application through UIAutomation.

Ian
  • 11,280
  • 3
  • 36
  • 58
0

You can use this command: xcrun simctl io booted screenshot Screenshot.png

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 01 '23 at 15:54