Template:Building CyanogenMod

==Prepare the Build Environment==
 * NOTE: You only need to do these steps the first time you build. If you previously prepared your build environment, skip to Copy proprietary files.

Install the ADB

 * Install the Android SDK

Install the Build Packages
Install using the package manager of your choice:

For 32-bit & 64-bit systems:

For 64-bit only systems:
 * NOTE:  is no longer available for Ubuntu 11.04 64-bit, but should still build without issue.
 * NOTE:  is no longer available for Ubuntu 11.04 64-bit, but should still build without issue.

Create the Directories
You will need to set up some directories in your build environment.

To create them:

Install the Repository
Enter the following to download make executable the "repo" binary:
 * NOTE: You may need to reboot for these changes to take effect.
 * NOTE: You may need to reboot for these changes to take effect.
 * NOTE: You may need to reboot for these changes to take effect.

Now enter the following to initialize the repository:

Copy proprietary files

 * NOTE: This only needs done the first time you build. If you have already done these steps, you may skip to Download RomManager.

You will need to have a with a working copy of CyanogenMod install and ADB working on the computer. This script will copy the proprietary files from the device.

Connect the device to the computer and ensure that ADB is working properly.
 * NOTE: If some hardware isn't working, like camcorder or FM radio, you will need to find the updated prop blobs.
 * NOTE: If some hardware isn't working, like camcorder or FM radio, you will need to find the updated prop blobs.
 * NOTE: If some hardware isn't working, like camcorder or FM radio, you will need to find the updated prop blobs.

Fetch Prebuilts

 * NOTE: This only needs to be done when an update to the prebuilts is released. If you are-up-to date, you may skip to Building CyanogenMod.

Download the prebuilts which are needed by the build:

Check for updates
First, check for updates in the source:

Configure Build & Compile
Now, the environment must be configured to build and the ROM compiled, from code, for the.

Install

 * 1) Copy your .zip file from ~/android/system/out/target/product//cm-XXXXX.zip to the root of the SD card.
 * Optional: Download Google Apps for CyanogenMod 9 and place it on the root of the SD card.
 * 1) Flash both of these .zip files from recovery.