fix(video): support iOS device recording on macOS 26 Tahoe - #938
Conversation
Embed idb_companion's processed Info.plist into every command-line Mach-O slice so NSCameraUsageDescription is available to TCC. Add a build and packaging verifier that rejects missing or mismatched privacy metadata. Check Camera authorization before CMIO device discovery, log the initial and post-request states, request access when notDetermined, and fail with actionable errors for denied, restricted, or unknown states. This makes permission failures distinguishable from Tahoe capture-device discovery failures. Add unit coverage for authorized, denied, restricted, unknown, and notDetermined transitions, including the guarantee that denied authorization stops before CMIO setup and device discovery. Port the implementation to main's Swift FBDeviceVideo and relocated Companion project introduced by 61c982f and b75d8f5. Keep main's arm64 build and distribution flow while verifying every Mach-O slice present in the resulting CLI. Verification: bash syntax validation passes; the generated Companion Xcode project contains CREATE_INFOPLIST_SECTION_IN_BINARY; FBDeviceControl and the new Swift test bundle compile with Xcode 26.3; all 7 focused authorization tests pass. The full companion build reaches the idb_companion Swift target but remains blocked by main's pre-existing missing ReplProtocol module configuration from acba50b.
|
Hi @truebit! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Keep the direct AVCaptureDevice UDID lookup as the fast path, then reuse an availability-aware discovery session to enumerate external and Continuity devices when Tahoe exposes the iOS screen source under a transformed identifier. Match only muxed devices whose model is iOS Device. Prefer a unique normalized-UDID match, fall back to a unique exact device-name match, and use the sole candidate only when the requested UDID is the only connected device. Log inventory changes and reject ambiguous matches while retaining the existing 10-second fast timeout. Declare NSCameraUseContinuityCameraDeviceType in the companion Info.plist and extend the build verifier to require both camera privacy keys in every Mach-O architecture. Add Swift unit coverage for transformed identifiers, name and singleton fallbacks, filtering, and ambiguity handling.
|
@xgerrit has imported this pull request. If you are a Meta employee, you can view this in D111925521. |
Motivation
Fixes #894.
Physical-device video recording can fail on macOS 26 Tahoe for two independent reasons:
idb_companiondid not embed its processed Info.plist in the command-line Mach-O. As a result, TCC could not reliably readNSCameraUsageDescription, and camera authorization was neither explicitly requested nor clearly diagnosed.AVCaptureDevice.uniqueIDthat differs from the device's hardware UDID. The previousAVCaptureDevice(uniqueID: device.udid)lookup therefore returnedniluntil the existing 10-second timeout expired.These failures could surface as a missing camera permission prompt or an
MJPEG/H264/etc first-frame timeoutbecause no video reached the client.Changes
Camera privacy and authorization
CREATE_INFOPLIST_SECTION_IN_BINARY=YES..videoauthorization state.AVCaptureDevice.requestAccess(for: .video)when authorization isnotDetermined.denied,restricted, and unknown states.Tahoe capture-device discovery
NSCameraUseContinuityCameraDeviceTypein the companion Info.plist.AVCaptureDevice.DiscoverySession:iOS Device.Test Plan
bash -n build.shFBDeviceControlsuccessfully.idb_companion.NSCameraUsageDescriptionNSCameraUseContinuityCameraDeviceType = trueThe complete
FBDeviceControlTeststarget remains blocked by a pre-existing issue onmain:FBAMDeviceTests.swiftcannot findFBCreateZeroedAMDCalls.