设置ANDROID_HOME ENVIROMENTAL变量在Mac OS X变量、ENVIROMENTAL、ANDROID_HOME、Mac

2023-09-12 00:46:02 作者:太多的情绪没适当的表情

有谁后我做设定一个有效的解决方案 ANDROID_HOME 通过终端?

Could anybody post me a working solution for doing setting ANDROID_HOME via the terminal?

我的路径SDK是 /应用/ ADT / SDK

推荐答案

在哪里安装了Android的SDK取决于你如何安装它。如果你通过他们的网站下载了SDK,然后拖/扔下应用到你的应用程序文件夹,它是最有可能在 /应用/ ADT / SDK (因为它是你的情况)。

Where the Android-SDK is installed depends on how you installed it. If you downloaded the SDK through their website and then dragged/dropped the Application to your Applications folder, it's most likely in /Applications/ADT/sdk (as it is in your case).

如果您使用的是自制( BREW安装Android的SDK )安装了它,那么它设在这里:

If you installed it using Homebrew (brew install android-sdk), then it's located here:

/usr/local/Cellar/android-sdk/24.3.3 # Don't forget to check your SDK version.

打开终端窗口,输入以下内容(变幻出路径SDK是无论你安装了它):

Open the terminal window and enter the following (changing out the path to the SDK to be however you installed it):

export ANDROID_HOME=/Applications/ADT/sdk 
# or
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.3.3

一旦你有了这一套,你需要把它添加到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