At a glance
$ source build/envsetup.sh from your shell adds several functions to the build environment. These are listed below with short descriptions. Reference
build/envsetup.sh for the most recent list of commands.
||Builds using SCHED_BATCH on all processors|
||tapas [<App1> <App2> …] [arm|x86|mips] [eng|userdebug|user]|
||Changes directory to the top of the tree|
||Makes from the top of the tree|
||Builds all of the modules in the current directory|
||Builds all of the modules in the current directory and pushes them to the device|
||Builds all of the modules in the supplied directories|
||Builds all of the modules in the supplied directories and pushes them to the device|
||Greps on all local C/C++ files|
||Greps on all local Java files|
||Greps on all local res/*.xml files|
||Go to the directory containing a file|
||Add git remote for CM Gerrit Review|
||A git wrapper that fetches/pushes patch from/to CM Gerrit Review|
||Rebase a Gerrit change and push it again|
||Add git remote for matching AOSP repository|
||Builds the module(s) using mka and pushes them to the device|
||Cleans and builds using mka|
||Parallel repo sync using ionice and SCHED_BATCH|
||Utility to fetch changes from Gerrit.|
||Installs a boot.img to the connected device|
||Installs a recovery.img to the connected device|
See also Building Basics
Commands in greater detail
A few important functions that
$ source build/envsetup.sh adds to the build environment are detailed below.
mka improves upon
make by using
sched_tool to make full use of all the CPU threads available on your machine. This is usually equal to the number of cores in your CPU, unless you have HyperThreading, in which case it is twice the number of cores in your processor.
Breakfast is used to prepare the build environment for a specific device. You can use it in one of two ways:
$ breakfast [device name]
The first method prepares a device for building. If the device tree is not found locally, roomservice fetches the device tree and its dependencies from CyanogenMod’s GitHub repository (only officially supported CyanogenMod devices, of course). If you do not specify a device, a list of available devices that can be built is output.
brunch is equivalent to
$ breakfast [device name] && mka bacon
brunch sets up your build environment for a device and commences the build process of a full CyanogenMod (unofficial) release that can be installed through recovery.
lunch is used like
breakfast, except you can specify non-official devices or non-standard builds for your device. If building for an unofficial device, you must already have the device tree and all of its dependencies synced locally. The non-standard builds include special debug versions (e.g.
eng) and also allows you to build CyanogenMod for use on the Android Emulator. Unlike
lunch makes no assumptions with regard to device configuration locations and formats, so it will scan the entire tree for matching options (depending on the number of locally available devices, this may take a significant amount of time). To build after running
lunch, simply issue the command
mka. No bacon here… sorry.
List of all commands in envsetup.sh
Content of this page is based on informations from wiki.cyanogenmod.org, under CC BY-SA 3.0 licence.