Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recording an iOS device's screen from an OSX cocoa app with a lightning cable

It's possible in Quicktime, with New Movie Recording > Camera dropdown > select iOS device. AppShow and Screenflow both do it.

I've tried this

Applescript

tell application "QuickTime Player"
set myrec to new movie recording
  tell myrec
      set current camera to video recording device named "Morten's iPod touch"
  end tell
end tell

But this gives me

error "QuickTime Player got an error: Can’t set video recording device \"Morten's iPod touch\" of document \"Movie Recording\" to video recording device named \"Morten's iPod touch\" of document \"Movie Recording\"." number -10006 from video recording device "Morten's iPod touch" of document "Movie Recording"

AVFoundation Since iOS devices appear as cameras in Quicktime, I figured it would be a capture device in AVFoundation, but this code

for device in AVCaptureDevice.devices() {
    println(device)
}

Just gives me my Facetime HD camera and a microphone.

like image 690
Morten J Avatar asked May 05 '15 16:05

Morten J


People also ask

Is there an app to record screen on iPhone?

Record It If you look up a screen recorder for iPhone on the App Store, one of the apps that you are going to come across is Record It. As the name implies, this simple and easy-to-use iOS recording app lets you easily and quickly make screen recordings on your iPhone and iPad.

How to record videos from iPhone/iPad to Mac?

You’ll now see the Movie Recording screen turn into the iPhone, iPad, or iPod touch screen, unlock the iOS device as usual and the Home Screen will display on the Mac screen ready to record, when you want to start recording the video click on the red Record button

Is it possible to record connected iOS device screens with QuickTime?

For longtime Mac users, you may recall that it’s also possible to record the Mac screen with QuickTime too, a handy feature that has been available in OS X for quite some time. The introduction of the ability to record connected iOS device screens is much newer, however, and it’s sort of a hidden feature that is often overlooked.

How to record screen on MacBook Air?

Record your screen 1 Go to Settings > Control Center > Customize Controls, then tap next to Screen Recording. 2 Swipe up from the bottom edge of any screen. ... 3 Press deeply on and tap Microphone. 4 Tap Start Recording, then wait for the three-second countdown. 5 Open Control Center and tap . ...


1 Answers

You must opt in to see iOS screen devices in your OS X app.

See "How do I set up a mirroring session between iOS 8 and Yosemite?"

CMIOObjectPropertyAddress   prop    = {
    kCMIOHardwarePropertyAllowScreenCaptureDevices,
    kCMIOObjectPropertyScopeGlobal,
    kCMIOObjectPropertyElementMaster
};
UInt32                      allow   = 1;

CMIOObjectSetPropertyData(kCMIOObjectSystemObject, &prop, 0, NULL, sizeof(allow), &allow);

You can get the list of devices using:

NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeMuxed];
like image 72
Pierre Bernard Avatar answered Sep 17 '22 13:09

Pierre Bernard