Recording iphone screen while running app on xcode

To take a screenshot, use the screenshot operation:

xcrun simctl io booted screenshot

To record a video, use the recordVideo operation:

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

UPDATE

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

or as bellow:

  1. Launch Simulator app.
  2. Open File menu > Record Screen

enter image description here

  1. Recording indicator will show up on the upper right of the title bar. You can begin your recording after the indicator showing up. enter image description here

source


Yes, open quicktime and next.. ⌘ + ⌥ + N, in the screen click on the record button arrow and choose your device.

EDIT: from iOS 11 you can record the iPhone screen enabling the screen record.

  1. Launch Settings, and select Control Center.
  2. Add Screen Recording.
  3. Swipe-up from the bottom of the display to reveal Control Center.
  4. Tap Screen Recording button.

Screen Recording button


Use QuickTimePlayer:

  1. Connect iDevice to Mac.
  2. Open QuickTime
  3. File > New Movie Recording
  4. If you don't see your screen mirrored immediately, go to the dropdown arrow next to the record button and select Camera > iDevice

If you are recording from iOS Simulator:

  1. Start everything up in iOS Simulator
  2. Open QuickTime
  3. File > New Screen Recording
  4. Press record button. You will now be given the option to drag out an area of the screen to record.