How can I change the path to android\avd in my Android Studio

41,044

Solution 1

  1. Open control panel
  2. Then go to System
  3. Then go to Change Environment Variables of the User
  4. Then click create a new environment variables
  5. Create a new variable named ANDROID_SDK_HOME
  6. Set its value to your Android directory, like C:/users/<username>/.android

Solution 2

I tried suggested solution but did not work for me. In my case I have to add a different variable so steps for me were:

  1. Open Control Panel
  2. Then go to System and Security
  3. Then go to System
  4. Then go to Advanced system settings
  5. Then go to Change Environment Variables of the User
  6. Then click create a new environment variables
  7. Create a new variable named ANDROID_AVD_HOME
  8. Set its value to your Android directory, like C:/users/<username>/.android

Solution 3

How can I change the path to android\avd in my Android Studio ?

Let say you want to move avd directory from it's default C:\users\<username>\.android\avd to D:\Development\avd

  1. Move avd directory to desired location (ex. D:\Development\avd)
  2. Change or add environment variable ANDROID_AVD_HOME : D:\Development\avd
    • On Windows: Control Panel > System > Advanced system settings > Environment Variables
    • If variable doesn't exits Click New... and fill with aforementioned data.
    • If variable exists then select variable, click on Edit... and replace variable value with the new path (ex. D:\Development\avd)
  3. If you have already AVD, change avdName.ini to D:\Development\avd\avdName (ex. D:\Development\avd\Nexus_S_API_22.avd)

Solution 4

There is a simple way to move avd(in windows):

  1. open the directory: C:\Users\Username\.android\avd, you will find the directory named with your AVD and a .ini file

  2. move the directory to your desirable path, then change the path variable in the .ini file to the new location.

  3. start the Android studio, you will find that the AVD can work properly.

Solution 5

Just move the emulator folder(folder that ends with .avd) to new location and keep the .ini file in same location then change the path to new location in .ini file.

No environment variable needed to be changed or added.

old path path=C:\Users\nero\.android\avd\Android_Q.avd

new path path=D:\androidemuators\avd\Android_Q.avd

You can keep your emulator anywhere just need to tell .ini config file where your emulator is located.

Share:
41,044
Ron D
Author by

Ron D

Updated on October 31, 2021

Comments

  • Ron D
    Ron D over 2 years

    I have such exaption

    InvalidPathException: Illegal char  at index 9: C:\Users\??????\.android\avd\1.avd (show balloon)
    

    when trying to create emulator. Can I change the location of directory .android?