Android Studio Emulator
Android Testing Tools

Getting Started | How to setup Android Studio Emulator (AVD)

Android Studio provides everything you need to start developing & testing apps for Android, including the Android Studio IDE, the Android SDK tools including the Android Studio emulator, an application that provides a virtual mobile device on which you can run your Android applications. The Android Studio emulator mimics all of the hardware and software features of a typical mobile device, except that it cannot place actual phone calls. To let you model and test your application more easily, the emulator utilizes Android Virtual Device (AVD) configurations.

Android Studio Emulator (AVD)

If you don’t know what a Mobile Emulator is, checkout our previous article ‘Mobile Emulator, Simulator & Read-device Testing‘. And why to use Emulator for Mobile Testing? Check here…To use the emulator, you first must create one or more AVD configurations. In each configuration, you specify an Android platform to run in the emulator and the set of hardware options and emulator skin you want to use. Then, when you launch the emulator, you specify the AVD configuration that you want to load and use a variety of commands and options to control its behavior.

An AVD consists of:

  • A hardware profile: Defines the hardware features of the virtual device. For example, you can define whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how much memory it has, and so on.
  • A mapping to a system image: You can define what version of the Android platform will run on the virtual device. You can choose a version of the standard Android platform or the system image packaged with an SDK add-on.
  • Other options: You can specify the emulator skin you want to use with the AVD, which lets you control the screen dimensions, appearance, and so on. You can also specify the emulated SD card to use with the AVD.
  • A dedicated storage area on your development machine: the device’s user data (installed applications, settings, and so on) and emulated SD card are stored in this area.

Android Virtual Devices

You can create as many AVDs as you need, based on the types of device you want to model. To thoroughly test your application, you should create an AVD for each general device configuration (for example, different screen sizes and platform versions) with which your application is compatible and test your application on each one. In this article, I will show you how to setup Android Studio & then Android Emulator to test your mobile web applications on Windows OS.

Pre-requisites

Before installing Android Studio, make sure you have JDK 6 or higher installed—the JRE alone is not sufficient. When developing for Android 5.0 (API level 21) and higher, you will need to install JDK 7 – To Download & Install it – Click here!

Download Android Studio

The very first step is to download the Android Software Development Kit (SDK) that will let you emulate Android on your local computer. Make sure to choose the version that is correct for your operating system. The size is around 1.1 GB and you need to check ‘I have read and agree with the above terms and conditions’.

1. Download the Android Studio [containing Android Software Development Kit (Android SDK] from Android Developers website.

Android Studio Download

2. Verify that android-studio-bundle is downloaded successfully.

Download Android Studio

Install Android Studio, SDK & the Tools

1. Launch “android-studio-bundle-version-os.exe”. This will open the ‘Android Studio Setup’ wizard, click Next. On the pop up “Choose Components”, there will be some components selected already. Follow the setup wizard to install Android Studio and any necessary SDK tools.

Android Studio Setup Wizard

2. By default Android Studio will be installed at location C:\Program Files\Android\Android Studio. The location must have at least 500 MB of free space.

3. By default Android SDK will be installed at location C:\Users\Username\AppData\Local\Android\sdk. The location must have at least 3.2 GB of free space.

4. Launch C:\Program Files\Android\Android Studio\bin\studio.exe. Follow the setup wizard to setup Android Studio and any necessary components.

On some Windows systems, the launcher script does not find where the JDK is installed. If you encounter this problem, you need to set an environment variable indicating the correct location. For Windows 7: Select Control Panel >> System and Security >> System >> Advanced System Settings. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_79.

Java - Android Studio Prerequisite

Launch Android Studio >> AVD Manager >> Create AVDs

You can create as many AVDs as you would like to use with the Android Studio Emulator. To effectively test your app, you should create an AVD that models each device type for which you have designed your app to support. To create and manage AVDs you use the AVD Manager UI or the android tool that is included in the SDK. The easiest way to create an AVD is to use the graphical AVD Manager.

1. Launch C:\Program Files\Android\Android Studio\bin\studio.exe.

2. Click on Tools >> Android >> AVD Manager Or, use the ‘AVD Manager’ icon present in the toolbar — it launches ‘Android Virtual Device Manager’ window showing your current virtual devices

Launch AVD Manager

OR

Launch AVD Manager Icon

3. Click ‘Create Virtual Device…’ button — it launches ‘Virtual Device Configuration’ window

Create Android Virtual Device button

4. Select Hardware (Choose a device definition) >> Whether you want to emulate a TV, Wearable, Phone or Tablet >> Select one of the existing device configuration (Model, size & resolution) Or, you can also create a new hardware profile >> Click NEXT

Select Hardware device configuration

In case the available hardware profiles do not match the device type you’d like to emulate, you can create a custom hardware profile for your AVD.

5. Select the System Image >> The Android version & the API level (You can download the required System Image) >> Click NEXT

Select System Image or Android Version API

6. Enter AVD Name >> Verify your AVD configuration >> Click FINISH

Verify AVD Configuration

7. Now the newly configured Android Virtual Device (Android Emulator) is added to the list.

AVD List

Launch AVDs

1. Select the newly created emulator and click on ‘Launch this AVD in the emulator’ icon.

Launch Android Virtual Device (AVD)

2. It will launch the Android Studio emulator.

Now we are ready to test our mobile web application. Launch the web browser in the emulator and test your applications! Happy Testing 🙂

Save

Leave a Reply

Your email address will not be published. Required fields are marked *