How to rebuild Android source code after making changes to Android source files

I have Android source code on my system and it works great. But when I make some changes to the Android source files and run "make", it does not generate or update the files. Please correct me if I am mistaken.

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

ii) The file-zImage file of the Android kernel file does not change with any changes, even if we make any changes to the source code

Another question, if I create a new library folder inside / libcore, it is automatically selected at compilation. To create a new library folder outside of / libcore, I added my path to the /build/core/main.mk and .classpath files. However, it is not compiled at compile time. Can someone please confirm where we all need to make changes to add a new library file outside of / libcore

Regards, Yogesh

+7
android android-source
source share
2 answers

It depends on the exact repository you checked. But for most of them, the following recipe will work:

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

Note. If you are using the latest build, you must have a 64-bit system

UPDATE. For some reason, the page above is missing some important steps. So here they are

After you have completed the β€œrepo sync” step (it takes some time, but I assume that you did it because you have the source files), follow these steps:

$ . build/envsetup.sh $ lunch 

The last command will provide you with a list of parameters for which you want to build the platform. If you want to create for the emulator, select full-eng. Otherwise, select it for the specific device vendor.

After choosing a platform, be sure to first make a full choice of everything, because the entire Android platform is very interdependent. Therefore, you need to make sure that you have all the components.

During development, you can quickly create individual components. Using the following command:

 mmm <component_directory_name> 

For example:

 mmm external/rsync 

In addition, the build system does not modify the source and intermediate files with the source code. Everything goes to the out / target directory.

+10
source share

It depends on the change you want to make.

In the simple case, if the change is local (for example, adding some new lines to 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, let's say you create a new system service to replace the old one, which starts at boot time, as shown in the init.rc file. Then you probably need to:

  • Update init.rc file
  • Create an entire source for Android.
  • Flash new image
+4
source share

All Articles