android’s build system is complex but very well designed, it is very convenient once you know where to start, here is some tips:
- the first step, enter to android root directory, and run
. build/envsetup.sh
then run
help
to get some summary information - run
lunch 1
to set build environment
the default item 1 is generic-eng, you can add customized item via add_lunch_combo, eg.
add_lunch_combo mojo-eng
to add item for mojo product with variant as engineer, and run
lunch
to choose the lunch items - run
make
to build the system - if you do not want to build the whole system, given the make a target name, such as, systemimage-nodeps, userdataimage-nodeps, etc. all the target name is defined in build/core/Makefile. you can also use mm or mmm function to achieve this, example, run
mmm packages/apps/Launcher
to build Launcher application, enter packages/apps/Launcher and run
mm
do the same thing. - some useful function, croot, godir, cd $OUT, cgrep, gettop,
get_build_var - run emulator
emulator&
run ddms
ddms& - see detail in build/core/build-system.html
Advertisement