Android Reading notes Four

Source: Internet
Author: User

Fourth Chapter

This is a trip to the source code and learned how to download and compile the Android source code and the Linux kernel source code. To elaborate on some specific processes

First, the Android source code download environment

1. Install the environment configuration to download Android source code

(1) First create a directory to hold the download script file repo

(2) Download repo script file

(3) Create a directory to hold the Android code:

Make dir android_source

CD Android_source

(4) initialization

(5) Start downloading Android source code:

Repo Sync

2. Download part of the Android code in two ways

(1) Method one

Using the Repo Sync command

(2) Method two

Using the git clone command

The difference between the two is that the first one will generate a hidden directory in the current directory repo, which holds all the information needed to download the Android source code, specifies that the project source will be stored according to the actual path, and the second will only establish the project directory, and will not establish a hierarchical path structure.

3. Compiling Android Source code

Compiling the source code recursively invokes the Android.mk file in each project directory to compile the current project. The steps for compiling the source code are as follows:

(1) Under Linux Terminal Input Command source build/envsetup.sh or. build/envsetup.sh

(2) Select the target and set the compilation target using the lunch command

(3) Compile the Android source code, execute command make to compile,

4. Publish your apk as an Android built-in program

Copy the apk file directly into the System/app directory and generate the System.img file from the system directory.

5. Test the. img file with the simulator

Second, download and compile the Linux kernel source code

1. Download the Linux kernel source code

(1) Download the latest Linux kernel: Git clone https://android.googlesource.com/kernel/common.git

(2) Enter common directory, execute: git branch-a export kernel

2. Install the Android kernel's build environment

(1) Copy the arm-linux-gcc-4.3.3.tgz file and the arm-none-linux-gnueabi-arm-2008q3-72-for-linux.tar.bz2 file to the working directory.

(2) Unzip the top two compressed files

(3) Verify that the cross compiler is successfully installed and that the command is: ls/usr/local/arm-l

(4) Install LIBNCURSES5, command is apt-get install Libnccurses5-dev

3. Configuring and compiling the Linux kernel

This chapter introduces a lot of instructions, for the Linux kernel learning is very helpful, and further understand the content of the study, it is true that the book read Hundred of its self-righteousness.

http://www.cnblogs.com/xxyue/

Android Reading notes Four

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.