MacにAndroidアプリ開発環境構築

基本は公式サイトに従えばいい。
Installing the SDK

Android SDK

  1. SDKのダウンロード
    1. http://developer.android.com/sdk/index.html からMac版をダウンロード
    2. 任意の場所(e.g. ホームディレクトリ)に展開
    3. PATH を追加。以下を .bashrc なり .zshrc なりに追記

      $ export PATH=$PATH:~/android-sdk-macosx/tools:~/android-sdk-macosx/platform-tools
    4. シェルに反映

      $ source ~/.bashrc(.zshrc)
  2. SDKパッケージのインストール
    1. Android SDK Managerを起動

      $ android
    2. 必要なパッケージにチェックを入れ、[Install Selected] を押下
    3. [Accept All] にチェックを入れて [Install] ボタンを押下
    4. 完了したら [Close] を押下

Eclipse

http://www.eclipse.org/downloads/ からMac版をダウンロード。
[Eclipse IDE for Java Developers] を選べばよい。
その後任意の場所(e.g. /Applications)に展開。

ADT Plugin

  1. Eclipseを起動
  2. [Help] -> [Install New Software] を選び、右上にある [Add] ボタンを押下
  3. [Add Repository] というダイアログが出てくるので [Name:] に "ADT Plugin"、

    [Location:] に "https://dl-ssl.google.com/android/eclipse/" と入力して [OK] ボタンを押下
  4. "Developer Tools" にチェックを入れて [Next>] ボタンを押下
  5. 再度 [Next>] ボタンを押下
  6. "I accept the terms of license agreements" を選択して [Finish] ボタンを押下
  7. 途中 [Security Warning] というダイアログが出るので [OK] を選択
  8. インストールが終わると再起動を求められるので [Restart Now] を選択

EclipseAndroid SDKのインストール先設定

  1. Eclipseを起動
  2. [Eclipse] -> [環境設定] で [Android] の [SDK Location:] にSDKのパス (e.g. /Users/${USER}/android-sdk-macosx) を入力して [OK] を押下

Eclipseでの文字コードの変更

  • [Eclipse] -> [環境設定] の [Gereral] -> [Workspace] を選択し、[Text file encoding] で [Other] をチェックして [UTF-8] を選択