Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is different between ANDROID_HOME & ANDROID_SDK_HOME

Tags:

java

android

sdk

I have 2 directory that look same,

ANDROID_HOME=C:\Android\sdk

ANDROID_SDK_HOME=C:\Users[user]\AppData\Local\Android\Sdk

whats the different? can I set it in one dir?

like image 464
Muhamad Yulianto Avatar asked May 25 '18 02:05

Muhamad Yulianto


2 Answers

Based on the documentation:

ANDROID_HOME

ANDROID_HOME, points to the SDK installation directory. This has been deprecated, use ANDROID_SDK_ROOT instead.

If you continue to use it, the following rules apply:

  • If ANDROID_HOME is defined and contains a valid SDK installation, its value is used instead of the value in ANDROID_SDK_ROOT.
  • If ANDROID_HOME is not defined, the value in ANDROID_SDK_ROOT is used.
  • If ANDROID_HOME is defined but does not exist or does not contain a valid SDK installation, the value in ANDROID_SDK_ROOT is used instead.

ANDROID_SDK_HOME

The root of the user-specific directory where all configuration and AVD content is stored

can I set it in one dir?

Ideally you shouldn't, since they serve different purpose.

like image 153
Sagar Avatar answered Oct 08 '22 19:10

Sagar


Seems like the accepted answer is no longer valid. The current docs say:

 ANDROID_SDK_ROOT, which also points to the SDK installation directory, is deprecated.

Source table: https://developer.android.com/studio/command-line/variables#envar

like image 25
keponk Avatar answered Oct 08 '22 18:10

keponk