Cannot use laptop camera in App Inventor Emulator

I've downloaded the latest android emulator for Mac OSX using this link. However, the emulator cannot use the Mac OSX camera in the app inventor application. When I try to open the camera app, it shows black & white checkbox only. There isn't also any option which I could find in the aiStarter emulator settings to use the laptop camera hardware.

Attaching the screenshot when the camera app is opened, also the version of the emulator installed using the above link.

Hello,

There is a reason for this. That is an emulator, not a device, so you will not be able to take pictures with it. Try with an actual device.

1 Like

The emulator is running in the local device. Why can't it access local hardware with correct permissions? The same thing works for AVD. @ewpatton any help in this regard?

Of course, it cannot access the laptop camera, because it is an emulator. It runs seperately.

2 Likes

It will not work unless it is a physical device

Why? As an emulator is not a real device.

Instead, use your phone, then it will work

1 Like

Need to set the following properties to enable emulator to access laptop camera:

hw.camera.back=webcam0
hw.camera.front=webcam0

in two places:

  • Applications/AppInventor/extras/App_Inventor.avd/config.ini
  • Applications/AppInventor/extras/App_Inventor.avd/hardware-qmenu.ini

After that, need to reset the emulator using the following command

Applications/AppInventor/commands-for-Appinventor/reset-emulator
3 Likes

The challenge is that not every computer has a camera, and it used to be the case that if you specified a camera when one wasn't available the emulator startup would fail. That may no longer be the case. But in the scenario where App Inventor is typically used (computer labs in schools), the odds of a webcam are fairly small. As you've found, you can customize the emulator setup for your machine.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.