Android Training Course (8)

Source: Internet
Author: User

The Android code is huge. If you need to compile it all, it takes a lot of time, which leads to low development efficiency. Is there a way to compile and modify the code? The answer is yes, because in the face of so many code, development fails if there is no good method. Next we will learn how to compile a single directory.

 

In the top-level directory of android, run the following command:

. Build/envsetup. sh

 

After running the command, a lot of commands are added to the sh interpreter. The specific command is as follows:

-Croot: Changes directory to the top of the tree.

-M: Makes from the top of the tree.

-Mm: Builds all of the modules in the current directory.

-Mmm: Builds all of the modules in the supplied directories.

-Cgrep: Greps on all local C/C ++ files.

-Jgrep: Greps on all local Java files.

-Resgrep: Greps on all local res/*. xml files.

-Godir: Go to the directory containing a file.

 

The command croot is changed to the top-level directory; m is the source code tree; mm is the compilation of all modules in the current directory;

Mmm is used to compile all the modules that meet the condition. cgrep is used to find all local C/C ++ files. jgrep is used to find all local java files; resgrep is to find all local resource files res /*. xml; godir is to jump to the directory that includes this file.

 

The following shows how to use commands to compile a directory:

Android-2.0/system/core $ "> tony @ tony-desktop :~ /Arm/Android-2.0/system/core $ mm

========================================================== ====

PLATFORM_VERSION_CODENAME = AOSP

PLATFORM_VERSION = AOSP

TARGET_PRODUCT = generic

TARGET_BUILD_VARIANT = eng

TARGET_SIMULATOR =

TARGET_BUILD_TYPE = release

TARGET_ARCH = arm

HOST_ARCH = x86

HOST_ OS = linux

HOST_BUILD_TYPE = release

BUILD_ID = MASTER

========================================================== ====

Make: Go to the/home/tony/arm/Android-2.0 directory.

 

This command is in the directory ~ /Arm/Android-2.0/system/core starts compilation, which improves the compilation speed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.