Reputation: 805
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?
Upvotes: 16
Views: 21994
Reputation: 4573
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...
Upvotes: 2
Reputation: 1603
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
Upvotes: 24