We have a Asus Transformer Book and occassionally I use it for Android programming especially when I am at remote location (Desktop PC is still our first choice). Sadly, it only has 32GB on its first drive. Even after installing Android Studio and SDK on drives other than C drive, AS itself will still use C drive for cache and virtual drives.
Andrid Studio version: 1.1 RC 1
Tested OS: Windows 7
Compiler
In our example, we move some big folders of AS from C drive to D drive. The first step is to move Gradle compiler folder, which is pretty straightforward using GUI:
- From Android Studio, go to File > Other Settings > Default Settings.
- Select Gradle.
- Change Service directory path to desired folder.
- Save the setting.
At this point, you may close Android Studio, move .gradle from C drive (usually C:\Users\yourusername\.gradle) to destination folder. Reopen AS. AS should be working fine and .gradle will not be recreated at C drive.
Android Virtual Devices
Our next step is to move .android folder containing virtual devices to other drive. This involves modifying PATH information in Windows environment.
- Close Android Studio if any.
- Move .android folder (usually at C:\Users\yourusername\.android) to destination drive (e.g. D:\Android)
- From Windows, go to Control Panel > System > Advanced system settings
- Go to Advanced tab > Environment Variables.
- Under System variables, click New... button.
- Type in the following:
Variable name: ANDROID_SDK_HOME
Variable value: D:\Android - Click OK and OK again.
Cache Folder
Our last step is to move presumably cache folder for AS. This involves editing a text file of AS to tell AS to refer to custom location for cache folder.
- Close AS if any.
- Move .AndroidStudio to destination drive (e.g. D:\Android)
- Go to the folder where AS is installed (e.g. C:\Program Files\Android Studio).
- Go to bin directory and edit idea.propertis file using your favourite text editor.
- Uncomment and edit the following two lines. Point them to new location:
idea.config.path
idea.system.path
Re-launch AS again. Make sure .android, .AndroidStudio and .gradle folders are not re-created at C drive. Happy coding.