Balamurugan A
Balamurugan A

Reputation: 1974

How to speed up android build system

Generally, is there any steps/tricks to speed up the android build, apart from -jN option. Even for a single line change in kernel, running 'make bootimage', the android build system scans all Android.mk. Any ways to skip this at least ?

Upvotes: 4

Views: 4910

Answers (4)

Zakir
Zakir

Reputation: 2382

For building just the kernel this saved me a ton of time in Android L,M,N:-

m -j8 ONE_SHOT_MAKEFILE=build/target/board/Android.mk bootimage

Upvotes: 0

QJGui
QJGui

Reputation: 967

As the Balamurugan A's answers said,

If you invoke make target(module name/droid), the Android compile system will scan all Android.mk for loading and searching target. This is the make system needing to do to find all target for following compiling.

If you only want to compile one module, you can use mm/mmm. And if you want to increase the speed of compiling for the system, you can open CCache.

Upvotes: 0

Balamurugan A
Balamurugan A

Reputation: 1974

By referring build/core/Makefile, It shows that, we can see the sequence of commands running while building by passing SHOW_COMMANDS=1 while building Android as below,

SHOW_COMMANDS=1 V=1 make bootimage -j1 -n >bootimage.txt 

From this we can extract the commands which are necessary for our case, and we can put into a script to build. eg, bootimage.sh

Upvotes: 4

skoperst
skoperst

Reputation: 2309

Here you can find a summary of speedup methods: http://oldwiki.cyanogenmod.org/wiki/Howto:_Speed_up_building

Use an SSD and a strong 16GB RAM linux machine(not VM).

There is also the idea of RAM drive which is crazy fast, but I am not sure if its possible with the amount of space android needs for the build.

Upvotes: 1

Related Questions