繁体   English   中英

IntelliJ IDEA 12和Homebrew Android SDK

[英]IntelliJ IDEA 12 and Homebrew Android SDK

我已经通过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中创建一个新的Project / Android应用程序时,我无法获得android SDK的路径(在/ usr / local / Cellar /中),我无法复制/通过表单中的路径,IntelliJ打开Finder,无法访问/ usr / local / Cellar。

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

  1. Cmd Shift 在文件选择器对话框中显示隐藏文件

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

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

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

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

我推荐CrazyCoder的方法。

除了其他答案

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

sdkmanager "platforms;android-28"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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