正如标题所示,我正努力让模拟器在笔记本电脑上使用网络摄像头。我已启用前后摄像头访问摄像头。无论何时模拟器启动,它都会要求网络摄像头访问,这是我授予的。但是,当我在模拟器上打开相机应用程序时,网络摄像头无法工作。相机应用程序崩溃。Android模拟器未在Android Studio中使用网络摄像头
这里是一个图像使摄像机:基于在计算器上的其他职位
,提示我添加一行:hw.camera=yes
。以下是avd的配置文件。
avd.ini.encoding=UTF-8
AvdId=Nexus_5_API_21_x86
abi.type=x86
avd.ini.displayname=Nexus 5 API 21 x86
disk.dataPartition.size=1G
hw.accelerometer=yes
hw.audioInput=yes
hw.battery=yes
hw.camera=yes
hw.camera.back=webcam0
hw.camera.front=webcam0
hw.cpu.arch=x86
hw.dPad=no
hw.device.hash2=MD5:2fa0e16c8cceb7d385183284107c0c88
hw.device.manufacturer=Google
hw.device.name=Nexus 5
hw.gps=yes
hw.gpu.enabled=yes
hw.keyboard=yes
hw.lcd.density=480
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=yes
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
image.sysdir.1=system-images\android-21\google_apis\x86\
runtime.network.latency=none
runtime.network.speed=full
runtime.scalefactor=auto
sdcard.path=C:\Users\Roberto\.android\avd\Nexus_5_API_21_x86.avd\sdcard.img
skin.dynamic=no
skin.name=nexus_5
skin.path=C:\Program Files\Android\Android Studio1\plugins\android\lib\device-art-resources\nexus_5
snapshot.present=no
tag.display=Google APIs
tag.id=google_apis
vm.heapSize=64
在这个阶段,我不知道为什么,这是行不通的。有什么想法吗?
我可以确认您无法为前后相机使用相同的'webcam0'。 –
有同样的问题,上面提到的解决方案不起作用http://stackoverflow.com/questions/43848737/unable-to-connect-to-camera-avd – codeomnitrix
这解决了我的问题!只需选择webcam0作为背面,然后模拟正面,AVD会询问您要使用哪个网络摄像机。 – Romain