CMIO Camera Extension and debug log

I made s target of "Camera Extension" on Xcode macOS Swift app. I got Swift code with CMIOExtensionDeviceSource. I add NSLog() and String.write() to file under FileManager.default.temporaryDirectory.

My camera extension installaion was success and running with FaceTime.

But I cannot see NSLog output or debug output temp file on Xcode or Console. How can I see debug output from my Camera Extension?

I found a way.

  1. Install Camera Extension by OSSystemExtensionManager.shared.submitRequest and OSSystemExtensionRequest.activationRequest
  2. Start FaceTime or Quick Camera app, select your camera extension as video source.
  3. Check PID of your Camera extension by ps -ae | grep com.example.YourCameraExtension
  4. Run command log show --predicate 'processID == [PID]' --info
  5. You can see NSLog output from your Camera Extension

If someone has easier way, please let me know.

Hello,

I recommend using a Logger, take a look at this WWDC video for more info (the link is timestamped to the relevant section): https://developer.apple.com/videos/play/wwdc2020/10168/?time=369

CMIO Camera Extension and debug log
 
 
Q