8

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

3
  • Never had this problem, maybe because I use MotoDev Studio of Android (full eclipse install with plugins) developer.motorola.com/docstools/motodevstudio/download What are you using? Commented Nov 1, 2010 at 20:38
  • 2
    I don't intend to build an application for android instead i want to make some changes in android built-in files and recompile the source so that it can be send to the emulator, on top of which all applications can run. Commented Nov 1, 2010 at 20:45
  • @JoshMachine I am also having the same issue. I added some logs in the source files and did a make. How did you resolve your issue? Commented May 10, 2016 at 15:01

2 Answers 2

10

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Hello Vlad, so if I make some changes in the source files. lets say I add some logs and then do a make, will the new images in out/target/product get those changes?
Sorry, I haven't done android builds like that in ages. For older versions, no images would not change you have to build full rebuild to get new images. Have no idea what new Android platforms do in this case.
I did some changes one AndroidManifest.xml, and compile that app via mm -B, but after reopened that file, my changes were gone!
5

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

1 Comment

an adb root is probably necessary, that adb remount works. adb root and adb remount is only available on user-debug and eng builds of android

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.