Fourth Reading notes

Source: Internet
Author: User

A Download, compile, and test Android source code:

Configure the environment for Android source code downloads:

1. Create a directory to hold the download script file (repo)

2. Download Repo script file

3. Create a directory to hold Android source code

4. Initialization

5. Start downloading Android source code

Android Source code directory structure parsing

Download part of the Android source code:

Method One: Use the repo Sync command;

Method Two: Use the git clone command;

Compiling Android Source code:

    1. Initialize the compilation environment: Perform either of the two commands on the Linux terminal.

#source build/envsetup.sh

Or

. build/envsetup.sh

2. Select target: Use the lunch command to set the compilation directory.

3. Compile the Android source code: Run the following command to compile the Android sources:

#make

Out Directory structure analysis:

The Out directory is the default directory that holds the target files generated by the compiled Android source code.

Publish your apk as an Android built-in program:

The simplest way to embed the APK program in a sysytem.img file is to copy the apk file to the Sysytem/app directory and then generate the System.img file from the system directory.

Two Download and compile the Linux kernel source code:

Download the Linux kernel source code: Execute the following command:

#git Clone Https://android.googlesource.com/kernel/common.git

The directory structure of the Linux kernel source code.

Install the Android kernel compilation environment:

Compiling the Linux kernel under Ubuntu Linux requires the installation of a cross compiler.

To configure and compile the Linux kernel:

Use the following command to compile the Linux kernel:

#export Path=/root/compilers/arm-none-linux-gnueabi/bin:&path

#cd ~/linux_kernel

#make Clean

#make

Fourth Reading notes

Related Article

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.