Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 800
smace Avatar asked May 10 '13 15:05

smace


3 Answers

  1. Press CmdShift. 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 (e.g. another plugin is using that shortcut), another alternative is to add /usr to your finder favorites and navigate from there.

like image 154
CrazyCoder Avatar answered Nov 20 '22 21:11

CrazyCoder


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.

like image 1
JavaRocky Avatar answered Nov 20 '22 19:11

JavaRocky


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"
like image 1
eleven Avatar answered Nov 20 '22 21:11

eleven