Android Studio: Change the Cache Location

Note: This is an updated article to reflect the stable release of AS. If you are looking for the old one, please see here.

Android Studio (AS) creates a local directory .AndroidStudio to cache its own data. In most environments, this is acceptable. However, the size of the directory can easily exceed 300Mb and, if you have a space constraint on your home drive (or a roaming profile in windows), this may be better off in some other place.

The location of this directory is placed in an file in the bin/ directory of your AS is installed. Currently (AS 1.1.), the two variables are commented out and look like this:

The previous tutorials were suggesting enabling the two variables and changing the installed file itself. This posed two problems:

  1. First, you’d need admin rights or some alternative to have write access to the installed file
  2. Then, more importantly, AS rewrites the file with each update

Therefore, here are the steps to a friendlier approach:

  • Copy the file locally (e.g. in ${home}/
  • Enable the two properties:

  • Create an environment variable named STUDIO_PROPERTIES pointing to the local file:

Now, you can run AS and your cache directory will be created where you’ve specified.


A little experiment: If you find this post and ad below useful, please check the ad out :-)

One thought on “Android Studio: Change the Cache Location

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to top