簡體   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