12

我已经通过 Homebrew 安装了最新的 android SDK:

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

我已经从“android”工具安装了最新的 SDK,但是在 IntelliJ IDEA 12 中创建新的项目/Android 应用程序时,我无法找到 android SDK 的路径(在 /usr/local/Cellar/ 中),我无法复制/past 表单中的路径,IntelliJ 正在打开 Finder,无法访问 /usr/local/Cellar。

我正在寻找一种干净优雅的方式来在 IntelliJ IDEA 中添加自制的 android sdk

4

3 回答 3

24
  1. 在文件选择器对话框中按下CmdShift.显示隐藏文件

  2. 导航到/usr/local/Cellar/android-sdk/r21.1目录。

如果键盘快捷键不起作用(例如,另一个插件正在使用该快捷键),另一种选择是添加/usr到您的 finder 收藏夹并从那里导航。

于 2013-05-10T15:40:41.970 回答
1

在我找到 CrazyCoder 的答案之前,我通过软链接 android-sdk 做到了这一点:

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

我推荐 CrazyCoder 的方法。

于 2013-08-11T11:18:02.640 回答
1

添加到其他答案

默认情况下brew cask install android-sdk仅安装tools. 并且Intellij由于某种原因不将其识别为android sdk home。为了使其可识别,应该至少有一个平台。所以一些平台应该安装sdkmanager

sdkmanager "platforms;android-28"
于 2019-01-06T22:25:17.237 回答