Android Emulator Camera: Webcam, Virtual Scene and Image/Video
How the camera works in the Android Studio emulator: Virtual Scene, webcam, posters, the limits, other emulators, and feeding an image or video with DRVCAM.
Table of Contents
Sooner or later every Android developer or tester asks the same thing: how do I control what the camera sees inside the emulator? The Android Studio emulator has three camera sources and a few useful tricks, and it also has real limits. This guide covers the built-in options first, then other PC emulators, and finally a way to feed your own image, video or stream to apps running inside an emulator.
How the camera works in the Android Studio emulator
The emulator does not have a physical sensor, so each camera it presents to apps has to come from somewhere. You pick the source per camera when you create or edit the virtual device (AVD) in Device Manager. Open the AVD settings, go to Advanced Settings, and look for the Camera options for the front and back cameras. Depending on your Android Studio version, the choices are:
- None: the device reports no camera of that kind.
- Emulated: a simple generated picture, good for checking that your camera code runs.
- Virtual Scene (back camera): a small 3D room you can walk around, with posters on the walls.
- Webcam0 (or the name of another webcam on your computer): the live picture from a camera attached to the computer.
Menu wording changes slightly between Android Studio releases, so treat the names above as a guide and check the Run apps on the Android Emulator page on developer.android.com for the version you use. The official documentation is the place to confirm anything that looks different on your screen: Run apps on the Android Emulator.
While the emulator is running, the Camera page in the Extended controls (the three-dot button at the bottom of the emulator toolbar) is where you work with the Virtual Scene and see which camera the running app is using.
Using the Virtual Scene camera
The Virtual Scene is the most useful built-in option for testing, because you can move the camera to look at different things. Here is the basic routine:
- Set the back camera of the AVD to Virtual Scene and start the emulator.
- Open a camera app, or your own app's camera screen. Android shows the 3D room.
- Move the viewpoint with the keyboard. In the emulator documentation the movement uses the W, A, S and D keys together with the Alt key (Option on a Mac), and the mouse turns the view.
- Walk up to a poster and frame it the way you need.
Putting your own image on a poster
The emulator lets you replace a poster image with one of your own. In the Extended controls, open the Camera page and look for the image settings of the Virtual Scene, where each poster can be given a custom image from a file on your computer. Pick a picture, place the camera in front of that poster, and the app now sees your picture.
- Use a clear, high-contrast image. A QR code on a white background works well.
- Stand close enough that the image fills most of the frame, but not so close that the edges are cut off.
Using your computer webcam
If you set a camera to Webcam0 (or another webcam listed in the AVD settings), the emulator passes the live picture from that webcam to the app. This is handy for tests such as scanning documents held up to the camera, or checking exposure behaviour on a real moving scene.
- Make sure your computer has a webcam that works in other programs, and that no other program is holding it.
- In the AVD settings, choose the webcam for the front or back camera and save.
- Cold boot the emulator so the new setting is used, then open the camera app.
On Windows and macOS the operating system may ask whether the emulator is allowed to use the camera. If the app only shows a black screen, check that permission first.
What the built-in camera cannot do
| You want to | Built-in answer |
|---|---|
| Show a still image as the camera | Yes, but only through a poster in the Virtual Scene, and you must position the camera in front of it |
| Play a video file as the camera | Not built in. The camera sources are emulated, Virtual Scene, and webcam |
| Use a live stream as the camera | Not built in |
| Scan a QR code | Yes, with a QR image on a poster or a code held up to a webcam |
| Repeat the exact same frame on every run | Hard with the moving Virtual Scene view; easier with a fixed source |
Other PC emulators
BlueStacks, LDPlayer, Genymotion, MuMu and similar emulators are separate products, and each one has its own camera settings. Some let you choose a host webcam, some can show an image or a video as the camera, and some do neither. The menu names, the options and what is free or paid differ between products and versions, so look in the emulator's own settings and help pages instead of assuming it works like Android Studio.
A few general points hold for most of them:
- Camera settings are usually found in the emulator's per-instance settings or in a side toolbar, not in the Android Settings app.
- A change often needs the instance restarted before the app sees it.
- If the built-in feature does not cover your need, for example video as the camera in an app that opens the camera itself, you need a different approach, such as the one below.
Feeding an image, video or stream with DRVCAM
DRVCAM is a virtual camera for rooted Android. It replaces the camera picture that chosen apps receive with media you select. Besides the phone build, it has a separate emulator file for PC emulators. This is the route to take when the built-in options are not enough, for example when you want a video file or a stream to show up inside an app that opens the camera by itself.
What you need to know before starting:
- The emulator file is for Android emulators on Intel or AMD PCs (x86_64). The phone file is for real phones and tablets and is a different build.
- One file covers Android 9 to 17.
- DRVCAM needs root and an Xposed framework (an LSPosed-family framework such as Vector or LSPosed) active in the Android system. An ordinary non-rooted emulator image will not work. Your emulator must be rooted and must let you install and activate the framework.
- The free version works with images in one app at a time. Video, several apps, presets, the floating controller and the Camera Source switch come with the paid plans. Live RTSP or RTMP streams are video only and need a paid plan.
- DRVCAM is beta software and compatibility varies by app and by camera mode.
The rooting and framework part depends on the emulator you use, and DRVCAM cannot do it for you. The setup steps for Magisk, KernelSU and APatch are in How to Install DRVCAM on Rooted Android. Once root and the framework work, the steps are the same as in the DRVCAM user manual:
- Download the Emulator file from the DRVCAM page (not the Phone file) and install it in the emulator.
- Make sure the emulator is rooted, Zygisk is on, and an LSPosed-family framework is active. Restart the emulator after installing the framework.
- Open DRVCAM and grant root when your root manager asks. Do it quickly, because some root managers refuse on their own after a few seconds.
- Choose Try Free (no account, no payment) or sign in.
- Go to Settings, then Diagnostics, then Check Environment and tap Run. Root Access should read Ready and DRVCAM Module should read Active.
- Open Library and import an image. Paid plans can also import an MP4 video or add a stream by its rtsp:// or rtmp:// address. Tap Use source on the file you want.
- On Home, tap More under Target App, tick the apps that should receive the feed, and tap Done.
- Tap Enable.
- Open the target app and its camera. If the app was already running when you tapped Enable, close it fully and open it again.
Importing a file only adds it to your Library, so nothing changes on camera until you use it. You can crop or fit the picture with the framing options (Original, Camera frame, or a fixed ratio) and your original file is never changed. For comparing options, see the comparison of virtual camera apps for Android, and for repeatable test practice, virtual camera app testing.
Troubleshooting
| Problem | What to try |
|---|---|
| The emulator camera is black | Check the camera source in the AVD settings, the webcam permission on your computer, and cold boot the emulator |
| Root Access is not granted | Allow DRVCAM in the root manager's superuser list, then run Check Environment again |
| DRVCAM Module shows as off | Confirm the Xposed framework is active in its own manager and restart the emulator |
| The app still shows the real or emulated camera | Close the app completely and reopen it, check the app is ticked under Target App, and check Camera Source is on Virtual |
| Floating buttons do nothing | DRVCAM may not be active in the app on screen; close and reopen the app |
| Still photo capture fails | Live preview and video recording are the supported paths; try the other mode in the app |
| The built-in camera app does nothing | Some built-in camera apps use camera modes DRVCAM does not support yet; try another camera app first |
If a problem persists, use Settings, then Selected-App Diagnostics, then Read, and send the result with the app name, emulator name and Android version to support.
DRVCAM is a tool. You are solely responsible for how you use it, and DroidRooter is not responsible for any illegal use.
Frequently Asked Questions
How do I use my webcam in the Android Studio emulator?
Set the front or back camera of your AVD to a webcam (for example Webcam0) in the AVD's Advanced Settings, cold boot the emulator and open a camera app. Make sure the computer allows the emulator to use the camera and that no other program is using it.
Can I use a video file as the camera in the Android emulator?
Not with the built-in camera sources, which are emulated, Virtual Scene and webcam. A virtual camera tool such as DRVCAM can play a video as the camera of chosen apps inside a rooted emulator, on a paid plan.
How do I put my own image in the emulator's Virtual Scene?
Open the Extended controls, go to the Camera page and set a custom image for a poster in the Virtual Scene. Then move the camera in front of that poster. Check the Android Emulator documentation for the exact wording in your Android Studio version.
How do I move around in the Virtual Scene?
The emulator documentation describes using the W, A, S and D keys while holding Alt (Option on a Mac) and moving the mouse to turn the view.
Can I test a QR code scanner in the emulator?
Yes. Put a QR code image on a Virtual Scene poster and point the camera at it, or hold a code up to a webcam. Use a clear, high-contrast image and keep the code fully in frame.
Does DRVCAM work in BlueStacks, LDPlayer, Genymotion or MuMu?
DRVCAM has an x86_64 emulator file for PC emulators and needs a rooted system with an Xposed framework. Whether a particular emulator can be rooted and run the framework depends on the emulator and version, so test yours. Results vary by app.
Which DRVCAM file do I use for an emulator?
Use the Emulator file, built for Intel and AMD PCs (x86_64). The Phone file is for real phones and tablets. Each file covers Android 9 to 17.