How to build AICP on OS X 10.8.X?

This is a guide to build AICP on OS X Mountain Lion(10.8.X).

  1. Go to App Store on your OS X and download Xcode 4. Once it is installed, open Xcode and go to preferences.
    There you will find a tab "DOWNLOADS", open it and find "Command line tools". Click on INSTALL next to it. It will take a few minutes to download and install
  2. Make sure you have the android-sdk downloaded and adb and fastboot are setup, and they work.
    It's recommended to place the android-sdk to /usr/local/

Open up Terminal and type

java

If you don’t have Java installed you will get a prompt to install it.

Next we will install homebrew (you can also use macports if you like)

ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)

Now make sure android-sdk and homebrew are in $PATH

touch ~/.bash_profile && echo "PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools" >> ~/.bash_profile

Now run this and see if you need to update anything.

brew doctor

If you do (and you probably will once a day) type:

brew update

Now we need to get our dev packages

brew install git coreutils findutils gnu-sed gnupg pngcrush repo

Once that is done, run

brew outdated

if it shows anything, run

brew upgrade

Now run this to correct a few symlinks [Not sure if these are needed anymore] :

ln -s /usr/local/bin/gfind /usr/local/bin/find && ln -s /usr/local/bin/gsed /usr/local/bin/sed

Now to create our case sensitive image for our AICP project [NOTE: the 60g can be changed to anything. It only takes up what it needs but I used 60GB]:

hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "android" -attach ~/Desktop/Android

Now to create our working directory

cd /Volumes/Android && mkdir aicp && cd aicp
  1. Repo initialization:

    repo init -u https://github.com/AICP/platform_manifest.git -b n7.1

  2. sync repo:

    repo sync
  1. Build:

    . build/envsetup.sh
    brunch

  2. You can also build (and see how long it took) for specific devices like this:

    . build/envsetup.sh
    time brunch m7

Remember to make clobber every now and then!