Android emulators can simulate Camera device (see screenshot) For example I can test how my video recording module works:
What about iOS-Simulators? When I try to run my app which uses camera I get the next error
Thread 5: Fatal error: Unexpectedly found nil while unwrapping an Optional value
at line
let videoDeviceInput = try AVCaptureDeviceInput(device: defaultVideoDevice!)
so no simulated devices are available for iOS-Simulators?
The Camera doesn't show on iOS simulator, but works on Android emulator ❓ #1045.
For iOS, tvOS, and watchOS apps, you can choose a simulated device, under [Platform] Simulators, from the run destination menu next to the scheme menu in the toolbar. To add additional simulators of a product family running older versions of the operating system, choose Add Additional Simulators.
Simulator doesn't try to exactly simulate the GPU from the iOS or tvOS device you are simulating. For example, if you are simulating the iPhone XS, Simulator does not try to emulate the capabilities of an A12 GPU. Instead, Simulator translates any calls you make and directs them to the selected GPU on the host Mac.
According to Apple documentation, using camera with Simulator is not supported:
The following hardware is not supported in Simulator:
Ambient light sensor
Audio input, except for using Siri by choosing Hardware > Siri.
Barometer
Bluetooth
Camera
Motion support (accelerometer and gyroscope)
Proximity sensor
There is one known workaround which could be useful sometimes: https://github.com/YuigaWada/iCimulator
But it does not work with 3-rd party libs like WebRTC though...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With