Ubuntu10.04にAndroidアプリ開発環境構築

公式サイトにもあるし他のブログでも散々取り上げられているが自分用にメモ。

ia32-libsのインストール(64bitの場合)

64bitか確認する方法は前回のエントリ参照。

$ sudo apt-get install ia32-libs

JDKのインストール


$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

Eclipse

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

Android SDK

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

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

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

      $ android
    2. [Settings] を選択して "Force https://... sources to be fetched using http://..." にチェックを入れる。必要があればプロキシを設定
    3. [Available package] を選択して必要なパッケージにチェックを入れ、[Install Selected] を押下
    4. [Accept All] にチェックを入れて [Install] ボタンを押下
    5. 完了したら [Close] を押下

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. [Window] -> [Preferences] で [Android] の [SDK Location:] にSDKのパス (e.g. /home/${USER}/android-sdk-linux_x86) を入力して [OK] を押下