android build system

android’s build system is complex but very well designed, it is very convenient once you know where to start, here is some tips:

  1. the first step, enter to android root directory, and run
    . build/envsetup.sh
    then run
    help
    to get some summary information
  2. 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
  3. run
    make
    to build the system
  4. 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.
  5. some useful function, croot, godir, cd $OUT, cgrep, gettop,
    get_build_var
  6. run emulator
    emulator&
    run ddms
    ddms&
  7. see detail in build/core/build-system.html
Advertisement

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.