RocketSimApp icon indicating copy to clipboard operation
RocketSimApp copied to clipboard

Simulator camera

Open AvdLee opened this issue 1 year ago • 1 comments
trafficstars

Create an option to Simulator the camera. In case the camera would be requested, we can launch RocketSim camera mode, create an image using the Mac camera, and return it as a file within the Simulator.

AvdLee avatar Nov 07 '24 12:11 AvdLee

Would love this feature. I have image capture and barcode scanning components in my app's flows and reaching for a physical device to work on these features really slows me down, especially if I'm working away from my desk

im-jersh avatar Feb 06 '25 00:02 im-jersh

This would be great! One of those things that you wonder why Apple hasn't done already.

zigfreid5 avatar Mar 26 '25 22:03 zigfreid5

Making progress on this feature: https://x.com/twannl/status/1926715711277203563

Now testing with actual projects.

If you're reading this: I'm looking for open-source camera projects to test this feature thoroughly!

Useful resources

  • https://nshint.io/blog/2019/04/08/testing-the-camera-on-the-simulator/

Todo

  • [x] Create a xcworkspace for easy testing
  • [x] Create a macOS and iOS SPM package
  • [x] Integrate the iOS package into RocketSimConnect so it works with existing code
  • [x] Rewrite the code to make it work via the existing connection?
  • [x] Integrate camera into RocketSim
  • [x] Add proper logging using OSLog
  • [x] Prevent main thread blocking when the camera is active
  • [x] Check memory usage in-app when using RocketSim Connect
  • [x] Reduce main thread usage in NWConnection handlers
  • [x] Send camera start stop messages
  • [ ] Show disconnected message in preview layer if so
  • [x] Reduce frame rate for better performance
  • [x] Warm up device
  • [x] Check memory usage in Mac app
  • [x] Create RocketSim Connect onboarding flow for Simulator Camera
  • [x] Make the camera connect if streamer appears later (poll until connection becomes available)
  • [x] Allow to disable/enable RocketSimConnect features from RocketSim's settings
  • [ ] Add support for audio inside videos
  • [x] Add capturing view to UIImagePickerController
  • [ ] Add support for AVCaptureMetadataOutput

Camera Capturer

  • It should only do work when the camera is actually required
  • It should always listen for Simulator Camera requests

AvdLee avatar May 26 '25 07:05 AvdLee

Feel free to give this a test with MovingBox!

camdenwebster avatar May 30 '25 12:05 camdenwebster

Feedback

Let's set up tests to cover all these incoming ones!

  • [ ] videoZoomFactor
Image
  • [ ] Add RocketSim Connect setup button to preferences
  • [ ] Add CMD + , to open preferences

AvdLee avatar Jun 19 '25 07:06 AvdLee

Closing this one as the foundation is implemented. Continuing development in dedicated issues!

AvdLee avatar Jun 26 '25 13:06 AvdLee