Building command tricks (Should know)

This recipe will equip you with some of the lesser known make command options.

Getting ready

All you need is a terminal window with the build environment set up.

How to do it...

The following table lists the command options for the standard make:

Command

Purpose

Make sdk

Builds the SDK

Make snod

Builds system image from currently available binaries

Make services

Creates the services JAR that contains all system services

Make runtime

Builds native code which serves as the glue between the Java-based Android framework and native stuff used for its functionality

Make droid

The default make

Make modules

Shows a list of all modules that can be built by using make <MODULE_NAME>

Make clean

Completely clears all compiled files

Make clobber

Same as rm -rf out/

Make clean-<LOCAL_MODULE>

Only cleans up any built files for LOCAL_MODULE

How it works...

These commands can be regularly used for several tasks during development. As an example, suppose I want to rebuild the Android framework and push it to the emulator, I can use the following sequence of commands written as a shell script:

You can save this build file as mk_frmwrk.sh:

#!/bin/sh
mmm -j4 frameworks/base frameworks/base/core/res snod
adb shell stop
adb sync
adb shell start

This will recompile the framework code, recompile the resources, rebuild system.img and sync it to the currently connected device.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.0.192