简体   繁体   中英

IntelliJ IDEA 12 and Homebrew Android SDK

I have installed latest android SDK through Homebrew:

brew install android
brew info android
android-sdk: stable r21.1
http://developer.android.com/index.html
/usr/local/Cellar/android-sdk/r21.1 (9032 files, 619M) *
  Built from source
https://github.com/mxcl/homebrew/commits/master/Library/Formula/android-sdk.rb
==> Caveats
Now run the `android' tool to install the actual SDK stuff.

The Android-SDK location for IDEs such as Eclipse, IntelliJ etc is:
  /usr/local/Cellar/android-sdk/r21.1

You will have to install the platform-tools and docs EVERY time this formula
updates. If you want to try and fix this then see the comment in this formula.

You may need to add the following to your .bashrc:
  export ANDROID_SDK_ROOT=/usr/local/opt/android-sdk

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

I have installed latest SDK from 'android' tool, but when creating a new Project/Android Application in IntelliJ IDEA 12, I can't had path to android SDK (in /usr/local/Cellar/), I can't copy/past the path in the form, IntelliJ is opening Finder and it's impossible to reach /usr/local/Cellar.

I'am looking for a clean and elegant way to add homebrew's android sdk in IntelliJ IDEA

  1. Press Cmd Shift . in the file chooser dialog to show the hidden files .

  2. Navigate to /usr/local/Cellar/android-sdk/r21.1 directory.

If the keyboard shortcut doesn't work (eg another plugin is using that shortcut), another alternative is to add /usr to your finder favorites and navigate from there.

I did this before i found CrazyCoder's answer, by soft linking the android-sdk:

ln -s /usr/local/Cellar/android-sdk/r21.1 /opt/android-sdk

I recommend CrazyCoder's method.

Addition to other answers

By default brew cask install android-sdk installs only tools . And Intellij by some reason doesn't recognise it as android sdk home. To make it recognisable there should be at least one platform. So some platform should be installed with sdkmanager :

sdkmanager "platforms;android-28"

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