I am installing Android Studio
and I have by default the path C:\\Users\\Administrator\\AppData\\Local\\Android\\sdk
to set my SDK
. If
I think most of the others answers address the issue, But I found more simple way for windows by adding few environment variables . (Might work for mac as well, I didn't test though)
ANDROID_SDK_ROOT - path to the SDK installation directory
default path - C:\Users\XXXX\AppData\Local\Android\Sdk Add enviroment variable ANDROID_SDK_ROOT - set value to desired location Eg: =E:\Android\local\Android\Sdk
For .android
folder
default path - C:\Users\XXXX\.android
Add enviroment variable ANDROID_SDK_HOME- set value to desired location
Eg: = E:\Android
For .gradle
folder
default path - C:\Users\XXXX\.gradle
Add enviroment variable GRADLE_USER_HOME - set value to desired location
Eg: = E:\Android\.gradle
For .androidstudioXXX
Android Studio-> Help-> Edit Custom Properties Add below lines
idea.config.path=E:/Android/.AndroidStudio4.0/config idea.system.path=E:/Android/.AndroidStudio4.0/system
Add environment variable STUDIO_PROPERTIES - set value to desired location Eg: = E:\Android\idea.properties
Finally don't forget to copy files from the original location to the new location.
Source : https://developer.android.com/studio/command-line/variables Please see the end of the page to know how to add the environment variable on Windows, Mac or Linux