Android studio cache directory configuration (windows version)

Android studio version 2021.3.1

First of all, the Android default directory is:

  • Android Studio program installation directory: C:\Program Files\Android\Android Studio, which is installed on the C drive by default, and you can choose the directory you want to install during installation.
  • Gradle cache directory: C:\Users\username\.gradle, this is the default cache Gradle cache directory, you can expand it in Android studio's File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle User home is set to the Gradle cache directory that you want to modify. In addition, you can also  GRADLE_USER_HOME specify the Gradle cache directory by configuring environment variables.
  • Android SDK directory: C:\Users\username\AppData\Local\Android\SDK, this is the default SDK directory, you can specify the SDK directory when you install the Android Studio program or start Android Studio for the first time, or later in Android studio File -> Settings -> Appearance & Behavior -> System Settings Expand -> Android SDK -> Android SDK Location Set to the SDK directory you want to modify.
  • Android Studio project directory: C:\Users\username\AndroidStudioProjects, this is the default project directory, when creating a new project, you can specify the project file storage directory.
  • The library file directory referenced by the project: C:\Users\username\.m2, you can add the MAVEN_REPOSITORY project in File -> Settings -> Appearance & Behavior -> Path Variables of Android studio to modify it.
  • Android studio's running cache and system configuration file directory: C:\Users\username\AppData\Local\Google\AndroidStudioXXX (eg: AndroidStudio2021.3)
  • The default avd cache directory of Android studio mainly stores avd (emulator) configuration and debugging key files: C:\Users\username\.android. Among them, you can configure the ANDROID_SDK_HOME environment variable to modify the emulator file storage location, and remember to save the original Copy the emulator file to the new directory you specified, and then modify the configuration file with the suffix *.ini in the avd directory, and change the path=F:\Android\cache\.android\avd\Nexus_6P_API_21.avd to your new directory. (Change both files in the new and old directories. Restart Androidstudio and check in the DeviceManager window whether the location of the emulator has been modified successfully. After success, you can delete the old directory)
  • Android Studio runs and configures the idea.properties file method: Add some custom configurations in the Android menu bar Help -> Edit Custom Properties, the first click may prompt you to create a file, confirm the creation, and then add the following content:
# Uncomment this option if you want to customize a path to the settings directory.
#---------------------------------------------------------------------
idea.config.path=F:/Android/.AndroidStudio/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the caches directory.
#---------------------------------------------------------------------
idea.system.path=F:/Android/.AndroidStudio/system

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the user-installed plugins directory.
#---------------------------------------------------------------------
idea.plugins.path=${idea.config.path}/plugins

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the logs directory.
#---------------------------------------------------------------------
idea.log.path=${idea.system.path}/log

 Change the previous directory path F:/Android/ to the directory you want to configure.

Guess you like

Origin blog.csdn.net/hnjcxy/article/details/127596450