3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Android]HomebrewでAndroidSDKをインストールする。

3
Last updated at Posted at 2020-11-27
  • Mac利用者で、Homebrewを利用してソフトウェアを管理している方、AndroidSDKもHomebrewで管理したい方向けです。

android-sdkのインストール

  • インストール方法は以下です。
$ brew install android-sdk

platform-toolsのインストール

  • Homebrew Caskにplatform-toolsというFormulaeがありそちらからもインストールできますが、先ほどインストールしたandroid-sdkに付属しているsdkmanagerを利用してインストールします。
  • android-sdkは不要で、adbやfastbootを利用したい場合、platform-tools単体でインストールすることも可能です。 そのため独立したFormulaeが用意されているのでしょう。
  • SDK Platform-Tools リリースノート  |  Android デベロッパー  |  Android Developersに以下の記載があるように、sdkmanagerでインストールしましょう。

Android デベロッパーは、最新の SDK Platform-Tools を Android Studio の SDK Manager から、または sdkmanager コマンドライン ツールから取得する必要があります。

  • Android Studioやintellijはsdkmanagerでインストールしたplatform-toolsが利用されます。
  • インストール方法は以下です。
$ sdkmanager platform-tools
  • また、インストールしたplatform-toolsのパスをzprofileやzshrcなどお好みの方法で通します。
$ export PATH=/usr/local/share/android-sdk/platform-tools:$PATH
  • これでadbやfastbootが利用できるようになっているはずです。

任意のSDK Platformのインストール

  • 以下のようにコマンドライン上で任意のSDK PlatformをインストールしておくことでAndroid StudioやintellijなどのIDE側でandroid-sdkとして認識してもらえるようになります。
$ export sdkmanager platforms;android-33

以上

  • これで以上になります。Android StudioやintellijなどのIDEに以下android-sdkのパスを設定することでHomebrewでインストールしたandroid-sdkを利用して開発を行うことができます。
/usr/local/share/android-sdk
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?