[Nexus 7 Android Development] frostincredible:
OS X Build Set Up 1.2 - By Kyle Frost (frostincredible)

So you want to build AOKP or CM10.1 on OS X? Well worry no longer my friends,

it is about to get a whole lot easier. Why is that? Because this script I've written will do pretty

much everything for you, from creating the case sensitive DMG to installing the required files,

to setting up all the folders. The best part? It also will initialize the AOKP or CM repo (depending

on your choice) and you can also build them straight from the script! How fantastic is that?!

Simply read on to see how! Make sure to follow all the instructions (there aren't many)!​

Follow these steps:

Go here and download OS X Build Set Up 1.2 (OSX_Setup-1.2.zip) - DOWNLOAD

Place the ZIP file on your Desktop.

Extract the ZIP to your Desktop.

Here comes the only tricky part. Open the file located at OSX_Setup/scripts/advanced_scripts/build_cm or build_aokp, whichever you're going to build.

Find this line -

# BELOW IS THE ONLY LINE YOU SHOULD BE EDITING. REPLACE *YOUR DEVICE* WHITH YOUR DEVICE'S CODE NAME. EX - NEXUS 7 = "grouper"

Just below that, edit this line with the instructions in the one I just posted -

cp /Volumes/Android/OUT/target/product/*YOUR DEVICE*/aokp_*YOUR DEVICE*-ota-eng.$ME.zip /Volumes/Android/Builds/AOKP_$ME.$NOW.zip

IT IS IMPORTANT THAT YOU DON'T EDIT ANYTHING ELSE.

Open your favorite Terminal application (the default on is Terminal located at /Applications/Utilities/Terminal).

cd to the OSX_Setup folder on your Desktop.

cd /Users/YOUR NAME/OSX_Setup

Run the following -

./runme

After running this, you will be presented with the following menu -

============================================================
OS X Build Set Up 1.2 - by Kyle Frost
============================================================

---Main Menu---

1 - Create DMG
2 - Install required files (MUST install MacPorts first)
MacPorts available free at www.macports.org
3 - Set up folders

WARNING: DO NOT RUN ADVANCED MENU UNTIL
YOU HAVE RUN ALL 3 ABOVE, OR HAVE DONE
THEM ALL MANUALLY. THANK YOU.

0 - Advanced Menu

x - Exit

Enter option:

As you can see, you need to go here and install MacPorts before proceeding - MacPorts

After installing MacPorts you can go ahead and run everything.

Create DMG will give you the options of creating a 25GB, 30GB, 40GB, 50GB, or 60GB DMG. 25GB is the lowest recommended by the Android Team.

Install required files will simply do just that, it will install the files needed as specified in the AOSP documents. This can take a while, so go take a nap while it runs.

Set up folders will give you the option of setting up the folders for AOKP or CM10.1. Simply choose which you want and the folders will be created.

Choosing Advanced Menu will give you this -

============================================================
OS X Build Set Up 1.2 - by Kyle Frost
============================================================

---Advanced Menu---

MUST INSTALL XCODE BEFORE BUILDING!
XCODE IS FREE IN THE MAC APP STORE!

1 - Initialize AOKP Repo
2 - Initialize CM10.1 Repo

When building, it will give you a list
of devices. Enter the number for your device
configuration and the build will continue.
It will take a while the first time, as the
source must first completely download.

3 - Build AOKP
4 - Build CM10.1

Note: When the build is complete, you can
find the finished ZIP in the Builds
folder on your Android disk image.

0 - Go to Main Menu

Enter option:

There you can see you need to install Xcode, if you haven't already. It is free in the Mac App Store (this script is for OS X, you know).

All the options are pretty self explanatory. Make sure you have run the folder set up for the ROM which you wish to build first. Run the initialize option for your desired ROM before running the build option.

That is it! After the build has done (takes a while the first time you set all this up, much faster the next few times) you will be able to build your own nightly's, or whatever you so desire! Have fun!

Disclaimer: This will only work with devices that are officially supported by AOKP or CM10.1. If your device is not supported by their official repos, either wait to see if it is, try to edit my script to get the repo your device's tree is on, or wait until I get around to writing a tutorial on how to add custom repos.

Please do not redistribute this without my permission,

and feel free to hit that thanks button if you liked this.​

Originally posted here, however I thought I'd bring it to the device forums for the device I have, the Nexus 7. Enjoy!