[Motorola Droid 3] sylentprofet:
--- copied with permission from nathanpfry.com ---​

Hi everyone! Have you ever wanted to compile your own nightlies, but are too intimidated or "not a dev"?

For various reasons, I've decided to write a guide about how you too can enter the wonderful world of development.

Before we begin, I'm going to say one thing. I'll probably repeat it a bunch of times too, to be sure everyone reads it at least once while skimming through this. PLEASE GOOGLE YOUR QUESTION FOR AT LEAST 5 MINUTES BEFORE ASKING IT HERE. The main reason I wrote this guide is to try to refocus the point of the "Development" forums on XDA. There are many users out there that seem to think this is a place to make demands for answers without trying to contribute or learn anything themselves. Developing isn't an easy thing. You should know a little bit of Linux going into this, if not, prepare yourself for some reading. This isn't the place for you to ask how to install Ubuntu, or why you need 64 bit. Just have a little faith and trust me.

Major thanks goes out to Hashcode.. Seriously, you have no idea what an inspiration he's been. For all intents and purposes, this guide will show you how to set up your system and compile ROMs based on his work, perhaps even help work on fixes. I suppose I should thank google, cyanogenmod, team aokp, thingonaspring (minimoto rocks!) a few others. You know who you are.

On with the show.

Here's a list of things you will need:

1) A decent computer (at least dual core, 2+ gig of RAM, 50 gig free HD space) capable of running Linux

2) A copy of Builduntu

3) Spare time and the desire to learn.

Double check that your main system is 64 bit. 32 bit OS will not work!

Once you get Builduntu up and running (there are instructions @ the above link), read on.

You need to make a decision. What flavor of Android do you want to compile? In other words, AOKP, Cyanogenmod, AOSP, LiquidSmooth, SimpleAOSP etc etc etc.

For the purposes of teaching everyone, I'm going to base this guide on AOKP.

You've made it this far, you're basically almost there. *cue motivational montage music*

When Builduntu says, "initialize the build repo", that means to sync your source code with a git repository. Run these commands in a terminal:

mkdir ~/android

cd ~/android

The following command will do the actual initialization:

repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr1

Ok, after this next part you're going to want to take a break. It's time to actually download to your computer (sync) the source code. As of writing this guide, it is over 10 gigabytes of information, depending on which "flavor" of Android. In the terminal:

repo sync

Don't worry, just execute and walk away. Depending on the speed of your internet connection, this could take a long time. Anywhere from one hour to "maybe-you-should-do-this-before-you-go-to-sleep". Up next is actually doing the compiling.

When that finishes, you have the source code. Let's get to business. This next bit will probably take a while also, but again, it's a set-it-and-forget-it situation.

cd ~/android
source build/envsetup.sh
lunch yourdevicenamehere
make otapackage

That should do it! Watch for errors, but everything should work at this point. Again, how long this takes is completely dependent on how fast your computer is. If it completes without a hitch, you'll have a flashable zip file located in ~/android/out/target/product/yourdevicename/

Congrats, you just compiled from source! Now, if you really want to get adventurous, you can start delving into the code itself and make some changes. But this post isn't the place to get into all that. Good luck, and please say thanks if this guide was helpful!

PLEASE PLEASE PLEASE If you happen to find an error in my guide (not just a question about it!) PLEASE PM ME. I will give you credit in the post. A potentially useful fix could be buried pages deep in the thread and unfortunately get lost if it's only a reply. Thanks!