1. Disk space reserved about 40G, memory 3G, because the download of the Androd file is very large and compiled, will generate a lot of files
2. Virchobox
3. Press to install Ubuntu my version is 12.04
4. Install the Git tool. Android source code is managed using Git tools,
sudo apt-get install Git-core GnuPG
5. Install the Java SDK. Execute the following command on Ubuntu:
---This version will be installed on either sun or Oracle's JDK 1.6.
sudo apt-get install python-software-properties
sudo add-apt-repository Ppa:webupd8team/java
sudo apt-get update
sudo apt-get install Oracle-java6-installer
Optionally, update the default Java version by running:
$ sudo update-alternatives--config java
$ sudo update-alternatives--config javac
6. Dependencies of other packages. Execute the following command on Ubuntu:
sudo apt-get install Flex Bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential Zip Curl
sudo apt-get install git gnupg Flex Bison gperf build-essential Zip curl Libc6-dev libncurses5-dev:i386 X11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils Xsltproc zlib1g-dev:i386
7. Debugging Tools. Execute the following command on Ubuntu:
sudo apt-get install Valgrind
Two. Download the Android source code project.
1. Download the Repo tool. Execute the following command on Ubuntu:
mkdir ~/bin
Path=~/bin: $PATH
$ Curl Https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Press to install Git
sudo apt-get install Git-core
sudo apt-get install Libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev build-essential
2. Download the latest version of Android source code. Execute the following command on Ubuntu:
mkdir Android
CD Android
~/android$ ~/bin/repo init-u https://android.googlesource.com/platform/manifest-b android-4.3_r2.1
~/android$ ~/bin/repo Sync--If you disconnect and re-execute
3.1 Compile initialization:
Execute in Terminal:
SOURCE build/envsetup.sh
Or:
. build/envsetup.sh
Execute the following command in the terminal:
Lunch
After selecting the device you want to compile, after selecting, will initialize the related files of the compiled project, do not choose to press ENTER default.
3.3 Compiling the code:
Execute in Terminal: MAKE-J4
-j4: Indicates a four thread compilation
Android Source code compilation