Home > Android, Android how to, Tools > Using Android Virtual Devices (AVD’s)

Using Android Virtual Devices (AVD’s)


We moved. Please visit this link for this post.

 

 

 

What is the AVD? AVD is an emulator instance with specific configurations.

Creating the AVD

Need to enter this command:

android create avd -n <name> -t <targetID>

-n – name of creted AVD

-t - target ID, please check allowed targets by entering

android list targets

Select for which target need create AVD

When you enter this command you should receive a question which ask you whether you want to create a custom hardware profile. If yes then you should go through all steps and after that you will create custom AVD’s hardware profile.

Example:

android create avd -n my1.6 -t 2

I created AVD with name my1.6 for target 2(in my android SDK target 2 is Android 1.6, API level 4)

We created this one. What about moving AVD to the other location?

Moving AVD

For this operation need to run

android move avd -n <name> -p <new_path>

-n – name of moved AVD

-p – path to the new location

Example

android move avd -n my1.6 -p C:\Other

There are several issues in Microsoft Windows OS.

  • You can move AVD only in disk where installed .android(in my case I can’t move for example to the disk D:\), also don’t forget to use ” ” for catalogs such Documents and Settings and etc
  • You can move only to the directory which is not exists. android tool automatically creates it. If you will move to the directory which already exists you will receive and error

Renaming the AVD

This operation is also simple in use

android move avd -n <name> -r <new_new>

Example

android move avd -n my1.6 -r Android1.6

It’s good, but if need to delete the AVD?

Deleting the AVD

Use this command

android delete avd -n <name>

Example

android delete avd -n my1.6

That’s all. As you can see all operations with AVD are simple.

About these ads
Categories: Android, Android how to, Tools
  1. Pablo
    March 16, 2010 at 9:40 am | #1

    Hi,

    I´ve the following problem when creating the AVD in Ubuntu 9.04, before i create the AVD i check the targets available by using command “android list targets” but no results are retrieved by this command. Please any help with this problem???

    Best regards.

    • March 16, 2010 at 1:30 pm | #2

      I think you forgot to add tools folder from android to your PATH environment variable
      On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don’t see a line setting the path, you can add one:
      export PATH=${PATH}:/tools
      Don’t forget to reboot console or system after that.
      Good luck. If you will have question, please notify me.

  2. Pablo
    March 16, 2010 at 10:03 pm | #3

    Hi Oleg,

    Thank you for response but still have problems retrieving the Android List Targets, I have read that:

    “The android tool scans the /platforms and /add-ons directories looking for valid system images and then generates the list of targets.”

    but these directories are empty for me. Do you have any idea in order to populate these directories?

    Best regards.

    • March 17, 2010 at 10:05 am | #4

      Hi Pablo. It is not a problem.
      You need to start “Android SDK and AVD Manager” by typing android in command line. In new dialog select Available packages and install needed versions.
      Please notify me if you still have problems after that.

  3. Pablo
    March 17, 2010 at 12:31 pm | #5

    Hi again Oleg,

    You´re right now i can see the targets. Thank you so much for your support.

    Regards,
    Pablo.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: