Reputation: 8700
After installation of Android SDK, the folder .android
was created on the E:\
drive. As far as I know, this is the default folder of Android Virtual Devices for configuration files.
How can I move .android
folder to a different location?
(eg. from E:\.android
to E:\Android\.android
)
Upvotes: 128
Views: 109196
Reputation: 159
Chosen answer is kinda outdated.
As of Giraffe | 2022.3.1 (Stable): when changing the default android avd folder, you need to add a new environment variable for ANDROID_USER_HOME. The value should lead to the location of the new folder, in your case:
ANDROID_USER_HOME = E:\Android\.android
If you have android studio with a lower version (4.3 or earlier), you have to use ANDROID_SDK_HOME instead of ANDROID_USER_HOME.
ANDROID_SDK_HOME = E:\Android
To override the user preferences location for those older tools, set ANDROID_SDK_HOME to the parent directory you would like the .android directory to be created under.
If you have AVDs and you're not able to run them after changing the location of the .android
folder.
Then you might want to look at the *.ini
configuration file of each of your AVDs. It is located inside the avd folder E:\Android\.android\avd
If each emulator's path
does not lead to the new specified location, correct it.
Upvotes: 3
Reputation: 2147
ANDROID_PREFS_ROOT = D:\IDE\Externals\ANDROID_PREFS_ROOT (The folder you want to move to.)
Upvotes: 3
Reputation: 39
If you would like your avd sdcard and files on a different drive, go to $HOME/.android/avd
and move the folder <AVD_NAME>.avd
to someplace else
Edit $HOME/.android/avd/<AVD_NAME>.ini
and change
path=<NEW_AVD_LOCATION>/<AVD_NAME>.avd
$HOME
depends on your system. On windows it can be your user directory
Upvotes: 1
Reputation: 1256
If you want to move just the AVD folder and not everything else, use those environmental variables.
ANDROID_EMULATOR_HOME: Sets the path to the user-specific emulator configuration directory. The default location is $ANDROID_SDK_HOME/.android/.
ANDROID_AVD_HOME: Sets the path to the directory that contains all AVD-specific files, which mostly consist of very large disk images. The default location is $ANDROID_EMULATOR_HOME/avd/. You might want to specify a new location if the default location is low on disk space.
Upvotes: 2
Reputation: 131
If you go for this answer be aware of this note: Starting with Android Studio 4.2, the ANDROID_SDK_HOME environment variable is deprecated and has been replaced with ANDROID_PREFS_ROOT.
Upvotes: 13
Reputation: 8700
I've found the answer.
.android
folder to E:\Android
E:\Android
Setting the environment variable on Windows XP or Windows 7:
Upvotes: 245
Reputation: 2566
By default, the emulator stores configuration files under $HOME/.android/
and AVD data under $HOME/.android/avd/
. You can override the defaults by setting the following environment variables.
The emulator searches the avd directory in the order of the values in $ANDROID_AVD_HOME
, $ANDROID_SDK_HOME/.android/avd/
, and $HOME/.android/avd/
.
This page provides the list of environmental variables supported by android studio: https://developer.android.com/studio/command-line/variables
Upvotes: 29
Reputation: 119
In addition to the answer provided by Dariusz Bacinski
, you have to include the .android
folder in the ANDROID_SDK_HOME
path. It was not working for me if I did not include the .android
folder.
Upvotes: 6
Reputation: 1093
The path set in ANDROID_SDK_HOME
must exist. Otherwise the default path will be chosen.
But it is not necessary to include .android
. The AVD Manager creates a .android
folder, if not found in ANDROID_SDK_HOME
.
Upvotes: 9