83

My windows is on a 128GB ssd hard drive and its running out of space. the folder C:\Users\User\AppData\Local\Android has 2 folders android-sdk and sdk folders that use about 30GB of space.

Is it possible to move these folders to an external hard drive?

If it is possible what changes should I make in the android studio?

Ashkan Mobayen Khiabani
  • 30,915
  • 26
  • 90
  • 147

3 Answers3

101

I do the same thing. In Android Studio go to Settings, select Appearance and Behaviour then System Settings then Android SDK

You can choose the SDK location at the top.

You'll need to copy/paste the files to that location to save yourself the downloading time.

SQLiteNoob
  • 2,662
  • 3
  • 25
  • 43
  • should I copy both `sdk` and `android-sdk` folders? – Ashkan Mobayen Khiabani Jun 09 '16 at 12:55
  • 1
    It's normally `Users\User\AppData\Local\Android\Sdk` Copy that whole file into a new file you call `...\Sdk` and use that – SQLiteNoob Jun 09 '16 at 12:56
  • what is the `android-sdk` folder because it uses 22GB of space – Ashkan Mobayen Khiabani Jun 09 '16 at 12:57
  • I'm going to guess it's a legacy from the older versions - the sdk used to be in a file named android-sdk - now it's just in the Sdk folder. The actual droid versions are found in `sdk/platforms/` – SQLiteNoob Jun 09 '16 at 12:59
  • if you go into `android-sdk` - you can copy whatever you want from the `platforms` file to the `android/sdk/platforms` file - i believe that's where the bulk of the space is taken - or you can just leave it to SDK Manager and delete the old files. – SQLiteNoob Jun 09 '16 at 13:00
  • Can I delete it from C after copy it to D drive ? – Nemus Apr 29 '17 at 07:13
  • @Nemus yes, you can safely delete it once it has been copied to D. Just make sure you remember to point Android Studio to it – SQLiteNoob May 03 '17 at 17:58
  • 4
    This works exactly the same way on Mac too! Thank you so much :) – Mohit Singh Oct 29 '17 at 08:50
  • I have another file named `.android` beside `.android studio` and `.gradle` files within my `C:/myuser` that uses 7GB. What is this file and can I delete or move it? where should I point to this file in Android studio? – user3486308 Feb 18 '18 at 08:23
  • @user3486308 that folder should just have some personalized settings for android studio like your adbkey and a build cache. If you delete it, you might need to re-connect devices for debugging and other minor annoyances, but android studio should replace that folder automatically. – SQLiteNoob Apr 25 '18 at 16:06
  • @user3486308 Among other things, that folder contains the AVD images. – Nilpo Jun 02 '18 at 06:55
  • Thank you , also don't forget to rename the path under "nameDevice.ini" file if you already have a device under avd folder to your new destination. – Mehmet Katircioglu Mar 17 '21 at 09:52
6

Its very simple just copy the sdk to wherever you want and then change the sdk path in android studio. For that just open the local.properties file and set the path like this:

sdk.dir=your path here
Nongthonbam Tonthoi
  • 11,055
  • 6
  • 30
  • 59
1

To keep the most used simulator in SSD drive and the others used for testing in the slow drive i created Symbolic. They are NTFS objects that appear in a folder as a sub folder but can that point to another folder on another drive.

To create then, move to C:\Users\<user>\.android\avd and do this:

mklink /d W10.1_WXGA_Tablet_API_28.avd d:\androidSimulators\W10.1_WXGA_Tablet_API_28.avd

MDLink info here.

If using Linux based systems you can also do this with linked directories.

For windows 10 users, emulators are stored by default at here:

C:\Users\<user>\.android\avd
MiguelSlv
  • 9,553
  • 7
  • 72
  • 127