Fourth chapter source code download and compile

Source: Internet
Author: User

One : Download, compile and test Android Source code

(1) Configure the Android Source code download environment:

1.Create a directory to hold the download script file (repo) (you can put the script file in any directory, use ~/binhere).

2. Download repo script file (for download Android source code)

3. Create a directoryto hold the Android Source code (can be placed in other directories)

# mkdir Android-source

# CD Android-source

4. Initialize

5. Start downloading Android Source code

(2) Android Source code directory structure Analysis

(3) Download part of Android Source code:1, use repo sync command

2. Using the git clone command

(4) Compiling Android Source code

1. Initializing the compilation Environment # source build/envsetup.sh

2. Select Target

3. Compiling Android Source code

(5) Out directory structure Analysis

(6) Publish your APK as an Android built-in program

(7) test system with simulator . Img file

Two : Download and compile the Linux kernel source code

(1) Download the Linux kernel source code

# git clone http://android. googlesource.com/kernel/common.git

(2) directory structure of Linux kernel source code

(3) Install the Android Kernel's compilation environment

1. Preparation: The arm-linux-gcc-4.3.2.tgz file and The arm-none-linux-gnueabi-arm-2008q3-72for-linux.tar.bz.2 file is copied to the working directory.

2. Unzip the compiler

3. Verify that the cross compiler is successfully installed

4, installation libnctrses5

(4) Configuring and compiling the Linux kernel

Android porting is a Linux kernel transplant, and linux kernel porting is a Linux -powered migration. So in order to develop and test Linux drivers. Need to build two sets of development environment:Android Application development environment and Linux kernel development environment!

Fourth chapter source code download and compile

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.