To test our android application we should have an Android Virtual Device (AVD). We can create virtual device by click on AVD Manager like as shown below.
When we click on AVD Manager, a new window will open in that click on Create Virtual Device like as shown below.
Now select the required device type and Click Next to create a virtual device like as shown below.
Now we need to download and select the system image and click Next like as shown below.
Now verify the configuration of android virtual device (AVD) and click Finish like as shown below.
This is how we need to add android virtual device (AVD) in an android studio to test our android applications.
Once we are done with the setup of android virtual device in an android studio, create a sample application in the android studio and run the app using AVD manager. In case if you are not aware of creating an app, check this Android Hello World App.
To run android applications we need to click on Run button or press Shift + F10 like as shown below
After clicking on play button new window will open in that select Android Virtual Device (AVD) and click OK like as shown below.
This is how we can setup an android virtual device (AVD) emulator in android studio to replicate the functionality of real android devices.