Question

I have android source code in my system and it works fine. But when i make some changes in android source files and run "make" it doesn't generate/update any files Please correct me if i am wrong,

i) system should generate a new system.img file if changes have been made to its source code

ii) android kernel file-zImage file doesn't change with any change even if we make any changes to the source code

Another question if i create a new library folder inside /libcore it gets automatically picked up when compiling. For creating a new library folder outside /libcore i added its path in /build/core/main.mk and .classpath file. Still its not getting picked up during compilation. Can someone please confirm where all we have to make changes for adding a new library file outside /libcore

Regards, Yogesh

Was it helpful?

Solution

This depends on exact repository that you have checked out. But for majority of them the following recipe will work:

http://source.android.com/source/download.html

Note, if you are using the most recent build you must have 64-bit system

UPDATE: For some reason the page above is missing some vital steps. So here they are

After you done 'repo sync' step ( takes a while, but I assume that you did since you have the source files ), do the following:

$ . build/envsetup.sh
$ lunch

The last command will give you a list of options for which platform you want to build. If you want to build for the emulator choose full-eng. Otherwise choose one for your specific device vendor.

After choosing the platform make sure you do full make of everything first, because the entire android platform is very interdependent. So you need to make sure you have all the components.

When developing you can build individual components pretty fast. By using the following command:

mmm <component_directory_name>

For example:

mmm external/rsync

Also, the build system does not change put the output and intermediate files with the source code. Everything goes into out/target directory.

OTHER TIPS

It depends on the change you want to make.

In an easy case, if the change is local (e.g., adding some new lines into an existing android source files called xxx.c), you can easily run:

mm -B (under the root directory of xxx.c)
adb remount
adb sync
adb reboot

In other cases, say, you create a new system service to replace the old one which is started at boot-up time as shown in init.rc file. Then, you probably need to:

  1. Update init.rc file
  2. Build whole android source
  3. Flash new image
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top