Download Android source code (grass)

Source: Internet
Author: User

Android source code compilation steps
I. JDK Installation

1. Modify Source:

Sudo gedit/etc/APT/sources. List
Replace all URLs with mirrors.163.com

2. Update Source:

Sudo apt-Get update

3. Install jdk5.0:
(1)decompress jdk1.5.0_22.tar.bz2
Sudo tar -jxvfjdk1.5.0_22.tar.bz2-C // usr/local/
(2) Configure Environment Variables
Sudo Emacs/etc/profile is configured as exportpath =/usr/local/jdk1.5.0 _ 22/bin:/usr/local/ARM-None-Linux-gnueabi/bin: $ path
Source/etc/profile

4. view the version:

Java-version

Javac-version

6. Download the installation Toolkit:

Sudo apt-Get install build-essential

Sudo apt-Get install make

Sudo apt-Get install GCC (4.4)

Sudo apt-Get install g ++ (4.4)

Sudo apt-Get install libc6-dev

Sudo apt-Get Install patch

Sudo apt-Get install texinfo

Sudo apt-Get install libncurses-Dev

Sudo apt-Get install Git-coregnupg

Sudo apt-Get install flex
Sudo apt-Get install bison
Sudo apt-Get install gperf
Sudo apt-Get install libsdl-Dev
Sudo apt-Get installlibesd0-dev
Sudo apt-Get installlibwxgtk2.6-Dev
Sudo apt-Get installbuild-essential
Sudo apt-Get install zip
Sudo apt-Get install curl

Sudo apt-Get install ncurses-Dev

Sudo apt-Get install zlib1g-dev

Sudo apt-Get install valgrind

Sudo apt-Get install python2.5

Note: For ubuntu10.04, the GCC and G ++ versions do not need to be changed to 4.3, and the editing is very normal.

View GCC version: GCC -- version, G ++ -- version

2. Download android2.1 source code

1. Create a script directory:

~ $ Mkdir Bin

2. Create the android source code directory

~ $ Mkdir androidsrc

3. Install Git-core and curl from the source, that is, install git

~ $ Sudo apt-Get install Git-core
~ $ Sudo apt-Get install curl

4. Switch to the script directory. The downloaded script will be placed in the current directory.

~ $ CD Bin

5. Download the script
Curlhttps: // dl-ssl.google.com/dl/googlesource/git-repo/repo>/bin/Repo
~ /Bin ~ $ Curl http://android.git.kernel.org/repo>/home/zhuzl/bin/repo/* Note:/home/zhuzl/bin/for the respective bin directory */

6. Modify the script permission

~ /Bin $ chmod A + x Repo

7. Modify repo_url = 'HTTP: // android.git.kernel.org/tools/repo.git' In the repo'
Change to http: start

8. Add the directory where the script is located to the path and put it to the end.

There is a. bashrc file in the user's main directory. The specific implementation of this file is as follows:

CD ..

Gedit. bashrc

Add: exportpath = ~ /Bin2: $ {path}

Close and reopen the terminal.

9. Run the command in the android directory where the source code is stored.
Repo init-uhttps: // android.googlesource.com/platform/manifest.git-bandroid-2.1_r2.1p2
~ /Android $ repo init-uhttp: // android.git.kernel.org/platform/manifest.git-B android-2.1_r2.1p2

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.