Skip to content


How To Create An Android Virtual Device using AVD manager

The Android Emulator that is part of the Android development SDK is a very powerful tool. It lets you test your application right on your computer without a real Android device by emulating hardware and software features of an android device. That said, the emulator still can’t replace a real device. There are many features that the emulator don’t support and you need a real device to test them. And even otherwise it’s a good idea to always test your application on a real device too. The emulator however provides a debug/test environment right on your computer, which is very convenient.

You can create any virtual device to run on the emulator by using the AVD manager.  AVD stands for Android Virtual Devices. With AVD manager you can create and manage your android virtual devices. AVDs are nothing but a set of configurations that tells the emulator to mimic a particular device.

How to create an AVD?

Even though you can use the command line tool of Android SDK to create and manage AVDs, in this tutorial I am working with Eclipse and the graphical AVD manager to create an AVD. So, obviously you need to have Eclipse and Android plug-in for Eclipse installed.

Locate the “Android SDK and AVD manager” icon on the Eclipse toolbar. Click to bring up the AVD manager.

1

Click on the virtual devices tab on the AVD manager and all your existing AVDs (if you have created any) would be listed.

AVD-mgr

Now, to create a new AVD. Click on the New button. The “Create a new Android Virtual Device” dialog appears.

AVD-NEW

Now, this is an important step. If you have any particular device in mind that you want to emulate (that’s why we’re here aren’t we?), you need to create an AVD that resembles the features of your target device. Like, for example, you need to know the screen size and resolution and so on. Anyway, but if you are creating a generic AVD then probably you can get away without going into much details and creating your AVD with the features that you need to test your application.

Okay, let’s name our AVD “MyAVD”, Select target as Android 2.2 , which means the application you are testing would be tested against the Android 2.2 system image on the emulator. Usually, this is where you can stop defining settings and click on Create AVD to create your new virtual device. But as per your requirement you may go ahead and specify various other optional settings. For example, you can emulate an SD card by defining the size of the card, or add specific hardware features (Want your device to feature a trackball?) by clicking the New button on the hardware section and selecting a property etc.

Android-AVD-Add-Hardware-features-trackball

Anyway, I am keeping this simple and creating an AVD with the bare minimum. So I just give my device a name and select the target API (which automatically selects the skin), and I am all set to create my AVD. This is what my AVD manager screen looks like now.

Avd--maanager-final

No, all we need to do is to click on the Create AVD button to create our new virtual device. Once created, you can see it listed in the virtual devices tab of the AVD manager.

AVd-device-list

That’s it, we have created a new AVD using the Android SDK/AVD manager. In the next tutorial we’ll see how to test/debug your application using different AVDS.

Posted in Android. Tagged with , , , .

12 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Roy Sarkis said

    Hi , thank you for this great application but i have one thing that isn’t working… when i try to select a target i can’t (i can’t select any target , there is no target to select) so what should i do

  2. Apurba said

    Hi Roy, Do you have the different version of Android SDKs and APIs installed? You need to have these installed to have it available as target. If not install them first using the Android SDK and AVD Manager.

  3. Imran ALi said

    i try same method but my device is not working.
    i am getting error

  4. William said

    It says I’m not allowed to do so.
    What’s wrong?
    I can’t create a AVD… :(

  5. Ramanan said

    Hi.. its working welll… but i cant use sd card for storing apk files.. i donno how to use sd card and how to add android app in that and use it in AVD manager

  6. razzul said

    my target button is not working .what to do now ?
    plz help me ,,,,,,,,,,,,,,,,,,,

  7. Apurba said

    @razzul, Do you mean that you are not able to select the target api? If so, make sure that the api version you want to target are actually installed. You can only target the api that have been installed.

  8. Kiran sonkusale said

    Target field is disable and blank. How it will get enabled and desired android platform.

  9. Eugeth said

    Hey there,

    what’s the main difference between choosing “Android” or “Google API” in the target box?

    Cheers!

  10. Jaytirth said

    thanks ! This post helped me a lot.

  11. Roshan said

    it says missing mksdcard.exe….????

Continuing the Discussion

  1. How to run/test your app with different Android Virtual Device(AVDs) linked to this post on February 20, 2011

    [...] the last tutorial I talked about how to create an Android Virtual Device (AVD). Now, there are situations where you may want to test your application on different target APIs or [...]

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.