Repository navigation
feat(app): camera for iOS simulator apps (webcam, image, video) - #76
Merged
Merged
Conversation
Port serve-sim's simulator camera: libSimCameraInjector.dylib (vendored verbatim in app/macos/SimCameraInjector with LICENSE/NOTICE, built by a Runner script phase into Resources) swizzles AVFoundation inside an app launched with SIMCTL_CHILD_DYLD_INSERT_LIBRARIES. Its host helper runs in-process as SimCameraFeed (ObjC, one shm + IOSurface ring per simulator) behind the simutil/sim_camera channel. Device menu: Camera > webcam / Image / Video, Open app with camera, Turn off camera. MCP launch_app takes camera. simutil_apple 1.4.0 adds IosAutomation.launchWithCamera and installedApps. Release signing signs the dylib before the --deep app sign.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 34
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
iOS Simulator has no camera. This gives simulator apps one in the macOS desktop app, ported from serve-sim (Apache-2.0):
libSimCameraInjector.dylibswizzles AVFoundation /UIImagePickerControllerinside an app launched withSIMCTL_CHILD_DYLD_INSERT_LIBRARIES. Sources are vendored inapp/macos/SimCameraInjector/with LICENSE + NOTICE. Only the fake camera names and the fallback image text were changed, to say SimUtil. A Runner script phase builds it (arm64 + x86_64) into the app's Resources.SimCameraFeed(ObjC: a POSIX shm header and a ring of global IOSurfaces, one per simulator), behind thesimutil/sim_cameramethod channel. Sources: Mac webcam, image, looping video.launch_apptakescamera:webcam,webcam:<name>,image:<path>orvideo:<path>.simutil_apple1.4.0:IosAutomation.launchWithCamera(camera privacy grant +env-prefixedsimctl launchthroughCommandExec) andinstalledApps.release-app.yamlsigns the dylib before the--deepapp sign, because--deepskips Mach-O files in Resources.Apps get the camera through
AVCaptureDevice.default(_:for:position:), discovery sessions and the image picker. A known gap from upstream:AVCaptureDevice.default(for: .video)is not hooked.Screenshots
A test app with an
AVCaptureVideoPreviewLayer, launched from SimUtil (iPhone 17 Pro, iOS 27):The webcam source was checked too, through SimUtil's MCP
launch_app+screenshot.Verification
flutter analyze --fatal-infosandflutter test(114) inapp/;dart analyze --fatal-infosand the tests insimutil_apple.Type of Change
Summary by CodeRabbit
New Features
Bug Fixes
Documentation