Setting ANDROID_HOME enviromental variable on Mac OS X

转自stackoverflow

Where the Android-SDK is installed depends on how you installed it.

    1. If you downloaded the SDK through their website and then dragged/dropped the Application to your Applications folder, it's most likely here:
      /Applications/ADT/sdk (as it is in your case).
    1. If you installed the SDK using Homebrew (brew cask install android-sdk), then it's located here:
      /usr/local/Caskroom/android-sdk/{YOUR_SDK_VERSION_NUMBER}
    1. If the SDK was installed automatically as part of Android Studio then it's located here:
      /Users/{YOUR_USER_NAME}/Library/Android/sdk

Once you know the location, open a terminal window and enter the following (changing out the path to the SDK to be however you installed it):

export ANDROID_HOME={YOUR_PATH}

Once you have this set, you need to add this to the PATH environment variable:

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Lastly apply these changes by re-sourcing .bash_profile:

source ~/.bash_profile

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容