iOS模拟器中有相机设备模拟吗?
Android模拟器可以模拟Camera设备(见截图) 例如,我可以测试我的视频录制模块的工作原理:
iOS 模拟器怎么样?当我尝试运行使用相机的应用程序时,我收到下一个错误,
Thread 5: Fatal error: Unexpectedly found nil while unwrapping an Optional value
因此
let videoDeviceInput = try AVCaptureDeviceInput(device: defaultVideoDevice!)
没有可用于 iOS 模拟器的模拟设备?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 Apple 文档,不支持将相机与模拟器一起使用:
According to Apple documentation, using camera with Simulator is not supported:
有一种已知的解决方法有时可能有用:https://github.com/YuigaWada/iCimulator
但它不适用于像 WebRTC 这样的第 3 方库...
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...