Moving android-sdk and sdk folders to another drive
Asked Answered
V

4

107

My windows is on a 128GB ssd hard drive and it's 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?

Von answered 9/6, 2016 at 12:51 Comment(3)
Yep - Go into settings in android studio and you can select where you want the sdk to reside.Australopithecus
would it just move these folders too?Von
Nah, you'd have to copy-paste them yourself. I have an ssd primary and an hdd secondary that i use.Australopithecus
A
130

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.

Australopithecus answered 9/6, 2016 at 12:54 Comment(13)
should I copy both sdk and android-sdk folders?Von
It's normally Users\User\AppData\Local\Android\Sdk Copy that whole file into a new file you call ...\Sdk and use thatAustralopithecus
what is the android-sdk folder because it uses 22GB of spaceVon
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/Australopithecus
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.Australopithecus
Can I delete it from C after copy it to D drive ?Meteorite
@Meteorite yes, you can safely delete it once it has been copied to D. Just make sure you remember to point Android Studio to itAustralopithecus
This works exactly the same way on Mac too! Thank you so much :)Erose
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?Caraviello
@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.Australopithecus
@user3486308 Among other things, that folder contains the AVD images.Skolnik
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.Camion
Thanks! Very simple answer! But does it affect the speed of the build after we move it from the SSD drive?Anaesthesiology
B
8

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
Billbillabong answered 9/6, 2016 at 12:54 Comment(0)
C
3

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
Cyprus answered 3/2, 2019 at 3:40 Comment(2)
The question is about moving the Android SDK, not the AVDs.Digestif
@ArtemRussakovskii, yes but the goal is to release space. AVDs are huge and come inside SDK folderCyprus
F
0

I managed to create a link in C:/Users//AppData/ named Android pointing to D:/Users//AppData/Android doing so all android data are in another drive not in the main drive look how much space I saved doing this.

enter image description here

To create a link pointing to another drive first open your terminal in the directory you want to create a link.

I will use PowerShell, use this command to do it

New-Item -Path 'C:/Users/<username>/AppData/Android'  -ItemType SymbolicLink -Value 'D:/Users/<username>/AppData/Android'
Fete answered 24/9, 2023 at 19:41 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.