How to Move Android Studio Emulator AVDs to Another Drive and Free C: Drive Space

 

android_emulators

If you use Android Studio regularly, you may eventually notice that your C: drive is losing a large amount of free space even though you have not installed many new programs.

One of the reasons can be Android Studio's Android Virtual Devices (AVDs).

Android emulators can consume several gigabytes of storage. A single virtual device can become quite large because it contains Android system images, userdata, snapshots, cache files, and other virtual disk files.

By default, Android Studio stores AVD-related files under the user's Windows profile, commonly:

C:\Users\Atif\.android\avd

If your C: drive is running out of space, moving the AVD storage to another drive such as F: can recover significant disk space.

This guide explains how to move an existing Android Studio AVD to another drive without recreating it.


Why Android Studio AVDs Consume So Much Space

An Android Virtual Device is essentially a virtual Android phone or tablet.

Depending on the Android version, device configuration, system image, and usage, an AVD can contain several large files.

For example:

MediumTablet_Android8_API27.avd

may contain files such as:

userdata-qemu.img
cache.img
snapshots
system.img
vendor.img

Some of these files can be quite large.

If you have multiple Android versions and device profiles, the total storage usage can become substantial.

This is especially noticeable on computers where Android Studio, Gradle, Windows, and other development tools are already using the C: drive.


Before Moving the AVD

Close:

  • Android Studio
  • Android Emulator
  • Any running emulator processes

It is important that the AVD is not running while you move its files.

For this example, I will move the AVD to:

F:\AVDs\.android\avd

The example AVD is:

MediumTablet_Android8_API27

Your AVD name and drive letter may be different.


Step 1: Find Your Existing AVD

The default AVD directory is normally:

C:\Users\Atif\.android\avd

You may see something similar to:

C:\Users\Atif\.android\avd\
    MediumTablet_Android8_API27.ini
    MediumTablet_Android8_API27.avd\

The important point is that the AVD consists of an .ini file and the corresponding .avd directory.


Step 2: Create the New AVD Location

Create the following directory on your other drive:

F:\AVDs\.android\avd

You can use another location if you prefer.

For example:

F:\AndroidAVDs

However, in this example we will use:

F:\AVDs\.android\avd

Step 3: Move the .avd Folder

Move the large AVD folder from:

C:\Users\Atif\.android\avd\MediumTablet_Android8_API27.avd

to:

F:\AVDs\.android\avd\MediumTablet_Android8_API27.avd

Do not delete anything until you have confirmed that the emulator works from the new location.

After moving it, the structure should look like:

F:\AVDs\.android\avd\
    MediumTablet_Android8_API27.avd\

Step 4: Move the .ini File

This is an important part that can easily be missed.

When ANDROID_AVD_HOME is used, the emulator expects the AVD .ini file in the directory specified by that variable.

Therefore, move:

C:\Users\Atif\.android\avd\MediumTablet_Android8_API27.ini

to:

F:\AVDs\.android\avd\MediumTablet_Android8_API27.ini

Your final structure should be:

F:\AVDs\.android\avd\
│
├── MediumTablet_Android8_API27.ini
│
└── MediumTablet_Android8_API27.avd\
    ├── config.ini
    ├── userdata-qemu.img
    ├── ...
    └── ...

The .ini file and .avd directory should now be together.


Step 5: Edit the AVD .ini File

Open:

F:\AVDs\.android\avd\MediumTablet_Android8_API27.ini

It should contain the path to the new location.

For example:

avd.ini.encoding=UTF-8
path=F:\AVDs\.android\avd\MediumTablet_Android8_API27.avd
path.rel=avd\MediumTablet_Android8_API27.avd
target=android-27

The most important line is:

path=F:\AVDs\.android\avd\MediumTablet_Android8_API27.avd

This tells the emulator where the actual AVD directory is located.


Step 6: Create the ANDROID_AVD_HOME Environment Variable

Windows allows us to tell the Android emulator where AVD files are stored by using the ANDROID_AVD_HOME environment variable.

Open Windows environment variable settings.

Under User variables, add:

Variable name:
ANDROID_AVD_HOME

and:

Variable value:
F:\AVDs\.android\avd

Do not put quotation marks around the path.

The result should be:

ANDROID_AVD_HOME=F:\AVDs\.android\avd

Step 7: Open a New Command Prompt

After changing an environment variable, open a new Command Prompt.

Do not use an old Command Prompt window because it may still contain the previous environment.

Check the variable:

echo %ANDROID_AVD_HOME%

It should return:

F:\AVDs\.android\avd

If it does not, check the Windows environment variable again and make sure you opened a new Command Prompt.


Step 8: Check Whether the Emulator Can Find the AVD

You can use the Android Emulator command-line tool to check the available AVDs.

If your Android SDK is installed in the normal Windows location, run:

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -list-avds

You should see:

MediumTablet_Android8_API27

If the AVD appears in this list, the emulator can find its configuration.

This is also a useful command when troubleshooting AVD problems.


Step 9: Start the AVD Manually

You can test the AVD directly from Command Prompt:

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -avd MediumTablet_Android8_API27

If everything is configured correctly, the Android emulator should start normally.

You can then return to Android Studio and start the same AVD from the Device Manager.


Troubleshooting: Unknown AVD Name

One of the errors I encountered while moving the AVD was:

ERROR | Unknown AVD name [MediumTablet_Android8_API27], use -list-avds to see valid list.

Another important message was:

ERROR | ANDROID_AVD_HOME is defined but there is no file MediumTablet_Android8_API27.ini in $ANDROID_AVD_HOME

This error provides an important clue.

When:

ANDROID_AVD_HOME=F:\AVDs\.android\avd

is configured, the emulator expects to find:

F:\AVDs\.android\avd\MediumTablet_Android8_API27.ini

It is therefore not enough to move only:

MediumTablet_Android8_API27.avd

The .ini file also needs to be in the AVD home directory.

The correct structure is:

F:\AVDs\.android\avd\
    MediumTablet_Android8_API27.ini
    MediumTablet_Android8_API27.avd\

Troubleshooting With Verbose Emulator Output

If the emulator still does not start, use the -verbose option.

Run:

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -avd MediumTablet_Android8_API27 -verbose

This produces detailed diagnostic information.

It can help identify problems related to:

  • AVD configuration
  • AVD paths
  • Missing files
  • System images
  • Graphics
  • Snapshots
  • Emulator configuration
  • Environment variables

For example, if you see:

ANDROID_AVD_HOME is defined but there is no file ...

check that the .ini file exists directly inside the directory specified by ANDROID_AVD_HOME.


Useful Emulator Commands

These commands are useful when troubleshooting Android Studio emulators.

List available AVDs

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -list-avds

Start a specific AVD

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -avd MediumTablet_Android8_API27

Start an AVD with detailed logging

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -avd MediumTablet_Android8_API27 -verbose

Replace:

MediumTablet_Android8_API27

with the name of your own AVD.


Verify the Space Recovered on C:

Once the emulator is working from the new location, check:

C:\Users\Atif\.android\avd

The large .avd directory should no longer be there.

The large files should now be under:

F:\AVDs\.android\avd

Do not immediately delete anything if you are unsure whether another Android tool is using it.

First confirm that:

  1. The AVD appears in Android Studio.
  2. The emulator starts.
  3. Android boots normally.
  4. Apps can be launched.
  5. The emulator can be restarted successfully.

After confirming everything works, the old files can be removed if any unnecessary copies remain.


What About Other Android Studio Storage?

Moving AVDs can recover a significant amount of space, but AVDs are not the only files that Android development can store on your computer.

Other large directories may include:

.gradle
.android
Android SDK
Android Studio caches
Gradle caches

The Android SDK itself can also become quite large because different Android API levels and system images may be installed.

If your C: drive continues to lose space after moving AVDs, it is worth checking these locations separately rather than randomly deleting Android Studio files.


Important: Do Not Delete Your AVD Before Testing

A common mistake is to delete the original AVD immediately after changing its location.

A safer approach is:

Move
   ↓
Configure ANDROID_AVD_HOME
   ↓
Check with -list-avds
   ↓
Start emulator
   ↓
Confirm everything works
   ↓
Remove unnecessary old files

This gives you an easy recovery path if the new configuration does not work.


Final AVD Configuration

For the example used in this guide, the final configuration is:

Environment variable

ANDROID_AVD_HOME=F:\AVDs\.android\avd

AVD .ini

F:\AVDs\.android\avd\MediumTablet_Android8_API27.ini

AVD directory

F:\AVDs\.android\avd\MediumTablet_Android8_API27.avd

Check available AVDs

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -list-avds

Start the AVD

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -avd MediumTablet_Android8_API27

Debug the AVD

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -avd MediumTablet_Android8_API27 -verbose

With this configuration, the large AVD files can live on another drive while the C: drive is no longer responsible for storing the emulator's large virtual disk files.

 ------------------------------------------------------------------------------------------------------------------ 

Restart Android Studio after changing ANDROID_AVD_HOME.
Android Studio must be completely closed and restarted so that it picks up the new environment variable. If Device Manager appears empty after moving the AVDs, first restart Android Studio before recreating or modifying any AVD.

"%LOCALAPPDATA%\Android\Sdk\emulator\emulator.exe" -list-avds

If the AVDs appear there but Device Manager is empty:

Close Android Studio completely → reopen Android Studio → open Device Manager.

 

← Back to Home

Comments

Post a Comment