在没有相机的情况下运行模拟器 [英] Run an emulator without camera
问题描述
我想模拟一个没有内置摄像头的android设备,但找不到解决方法.创建新的仿真器(和硬件)时,我已在Android AVD Manager中禁用了摄像头选项,但是生成的仿真器仍然具有摄像头功能.我也尝试过使用Genymotion模拟器,但似乎甚至没有禁用摄像头的选项.
I want to emulate an android device that has no in-built camera but I can't find a way to do this. I have disabled the options for camera in the Android AVD Manager when creating a new emulator (and hardware), but the resulting emulator still has camera capabilities. I also tried using Genymotion emulator, but that doesn't even seem to have the option to disable camera.
原因:我的清单 android:name ="android.hardware.camera"
中有此行,该行可防止拥有不带摄像头的设备的用户安装我的应用(设备不兼容).我想在其中添加 android:required ="false"
,但这意味着我还必须实现一些代码,以防用户从我的应用程序访问相机功能而自己的相机功能不可用设备,我需要对其进行测试.
Reason why:
I have this line in my manifest android:name="android.hardware.camera"
that prevents a user that owns a device without camera from installing my app (Device not compatible). I want to add android:required="false"
to it but that would mean I also have to implement some code for the case where the user accesses a camera function from my app while not having one on his device, and I need to test that.
任何建议都值得赞赏.
推荐答案
尝试将 Camera
选项从 Front
和 Back
切换到没有
在设备高级设置中.
Try to switch Camera
options Front
and Back
to None
in device advanced settings.
这篇关于在没有相机的情况下运行模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!