android開発環境

参考:http://source.android.com/source/downloading.html
gitはXcodeを入れるとインストールされる
ここではAndroidのソースの取得とcoloredlogcatの設定まで

ファイルシステムの作成

大文字、小文字を区別するファイルシステムを作成する
ディスクユーティル>ファイル>新規>空のディスクイメージ

  • 名前:android
  • 場所:適当
  • 名前:android
  • サイズ:適当(今回はノートPCなので8G程度)
  • フォーマット:MacOS拡張(大文字・主時を区別 ジャーナリング)【重要】
  • 暗号化:なし
  • パーティション:ハードディスク
  • イメージフォーマット:スパース・ディスクイメージ


Installing Repo

ツールのインストールディレクトリ作成
$ mkdir ~/bin

.bashrcに追加

export PATH=~/bin:$PATH
Repo落とす
$ curl https://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

ソース落とす

$ cd /Volumes/android/
$ mkdir mydroid
$ cd mydroid
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b gingerbread
$ repo sync

coloredlogcat

$ wget http://jsharkey.org/downloads/coloredlogcat.pytxt
$ mv coloredlogcat.pytxt coloredlogcat.py
$ chmod +x coloredlogcat.py 

bashrc

.bash_profileを作成
if [ -f ~/.bashrc ] ; then
. ~/.bashrc
fi
.bashrcを作成
ANDROID_HOME=~/develop/android/android-sdk-mac_x86

export PATH=/opt/local/bin:/opt/local/sbin:$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
export MANPATH=/opt/local/share/man:/opt/local/man:$MANPATH

alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'
alias logcat='adb logcat | ~/local/src/coloredlogcat.py'