在 Mac OS X 上安装 Android SDK 的位置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2677431/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:52:43  来源:igfitidea点击:

Where to install Android SDK on Mac OS X?

androidconfigurationmacos

提问by Carl Manaster

Where should the Android SDK be installed on Mac OS X?

在 Mac OS X 上 Android SDK 应该安装在哪里?

采纳答案by gmuraleekrishna

Now the android-sdkhas migrated from homebrew/coreto homebrew/cask.

现在android-sdk已从 迁移homebrew/corehomebrew/cask

brew tap homebrew/cask

and install android-sdkusing

android-sdk使用安装

brew cask install android-sdk

You will have to add the ANDROID_HOMEto profile (.zshrc or .bashrc)

您必须添加ANDROID_HOME到配置文件(.zshrc 或 .bashrc)

export ANDROID_HOME=/usr/local/share/android-sdk

回答by sorin

The easiest (and standard) way to install Android SDK under OS X is to use brew.

在 OS X 下安装 Android SDK 的最简单(也是标准)方法是使用brew.

brew install android-sdk

brew install android-sdk

If you do not have homebrew, here's how to get it.

如果您没有自制软件,请按以下方法获取

This will install Android SDK into /usr/local/Cellar/android-sdk/and, at this moment, this is the best location to install it.

这将安装 Android SDK /usr/local/Cellar/android-sdk/,此时,这是安装它的最佳位置。

回答by John Wang

My personal preference is to put it in ~/opt/local/android-sdk-macor /Developer/android-sdk-macthe latter being where Xcode and all the Apple Dev tools are held.

我个人的偏好是将它放在~/opt/local/android-sdk-mac或/Developer/android-sdk-mac后者是 Xcode 和所有 Apple Dev 工具所在的位置。

回答by rara

When I installed Android Studio 1.0 it ended up in

当我安装 Android Studio 1.0 时,它最终出现在

/Library/Android/sdk/

/图书馆/Android/SDK/

回答by Weston Ganger

By default the android sdk installer path is ~/Library/Android/sdk/

默认情况下,android sdk 安装程序路径是 ~/Library/Android/sdk/

回答by sudo bangbang

You can install android-sdk in different ways

您可以通过不同的方式安装 android-sdk

  1. homebrew
    Install brew using command from brew.sh

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  
    

    Install android-sdkusing

    brew install android-sdk
    

    Now android-sdkwill be installed in /usr/local/opt/android-sdk

    export ANDROID_HOME=/usr/local/opt/android-sdk
    
  2. If you installed android studio following the website,
    android-sdkwill be installed in ~/Library/Android/sdk

    export ANDROID_HOME=~/Library/Android/sdk
    
  1. homebrew
    使用来自brew.sh 的命令安装 brew

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  
    

    安装android-sdk使用

    brew install android-sdk
    

    现在android-sdk将安装在/usr/local/opt/android-sdk

    export ANDROID_HOME=/usr/local/opt/android-sdk
    
  2. 如果您按照网站安装了 android studio ,
    android-sdk将安装在~/Library/Android/sdk

    export ANDROID_HOME=~/Library/Android/sdk
    

I think these defaults make sense and its better to stick to it

我认为这些默认设置是有道理的,最好坚持下去

回答by Justin Johnson

From http://developer.android.com/sdk/index.html, it seems that you can install the SDK anywhere, so long as you

http://developer.android.com/sdk/index.html看来,你可以在任何地方安装 SDK,只要你

  1. "execute the android tool in the <sdk>/tools/folder"
  2. Add the <sdk>/toolsdirectory to your system path
  1. “执行<sdk>/tools/文件夹中的android工具”
  2. <sdk>/tools目录添加到您的系统路径

More info can be found here: http://developer.android.com/sdk/installing.html

更多信息可以在这里找到:http: //developer.android.com/sdk/installing.html

回答by CaseyB

I just have mine in MyUser/Documents/Development. I'm the only one that used my Mac, so I didn't need to worry about making it accessible system-wide.

我只有我的MyUser/Documents/Development。我是唯一一个使用我的 Mac 的人,所以我不需要担心让它在整个系统范围内都可以访问。

回答by airgray

I put mine in /Developer/SDKs I had to authenticate to do that…but since there's no consensus I thought that it sounded like a place I'd remember.

我把我的放在 /Developer/SDKs 中,我必须进行身份验证才能做到这一点……但由于没有达成共识,我认为这听起来像是我记得的地方。

回答by Tanner Watson

I ended up placing my at ~/sdks/android-sdk-mac_x86. I like to keep all of my SDKs in one place and for me an sdk folder under my home directory makes the most sense.

我最终将我的放在 ~/sdks/android-sdk-mac_x86。我喜欢把我所有的 SDK 放在一个地方,对我来说,我的主目录下的 sdk 文件夹最有意义。