Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rebuild android source code after making changes in android source files

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

like image 980
JoshMachine Avatar asked Nov 01 '10 20:11

JoshMachine


People also ask

How do you change source code on Android?

In Android Code Search (cs.android.com), navigate to the file you are interested in editing. Click Edit code. Git Source Editor opens with the file preselected for editing. Select the Git branch in which you want to edit the file from the Select a git branch dropdown list, then click Pick branch.

Where can I find Android source code?

The Android source tree is located in a Git repository hosted by Google. The Git repository includes metadata for the Android source, including changes to the source and when the changes were made.


1 Answers

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.

like image 172
Vlad Avatar answered Oct 17 '22 08:10

Vlad