简体   繁体   中英

Where to install Android SDK on Mac OS X?

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

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

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.

In homebrew the android-sdk has migrated from homebrew/core to homebrew/cask .

brew tap homebrew/cask

and install android-sdk using

brew cask install android-sdk

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

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

If you prefer otherwise, copy the package to

~/opt/local/android-sdk-mac

When I installed Android Studio 1.0 it ended up in

/Library/Android/sdk/

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

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

You can install android-sdk in different ways

  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-sdk using

    brew install android-sdk

    Now android-sdk will 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-sdk will be installed in ~/Library/Android/sdk

     export ANDROID_HOME=~/Library/Android/sdk

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

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

  1. "execute the android tool in the <sdk>/tools/ folder"
  2. Add the <sdk>/tools directory to your system path

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

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.

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

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.

I have been toying with this as well. I initially had it in my documents folder, but decided that didn't make 'philosophical' sense. I decided to create an Android directory in my home folder and place Eclipse and the Android SKK in there.

brew install android-sdk --cask 

A simple way is changing to required sdk in some android project the number of

compileSdkVersion

in build.gradle file and you can install with the manager

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM