Compile ut 12.10 64-bit compiling Android 4.2.1 _ R1 source code

Source: Internet
Author: User
The compilation environment recommended by Google is in Ubuntu lts (10.04), but the latest version 12.10 has been released, and there is no need to post on the old version. For versions 2.3.x and later, a 64-bit system is required, earlier versions earlier than 2.2 (including 2.2) can be compiled on the 32-bit version for virtual machines. The VM configuration parameters written on the official website are as follows: 16g RAM/swap & 30g + hard disk space PS: after all the hard disk space is compiled, it is found that the source code download/compilation is complete, the total disk space is 33 GB $ Du-h -- Max-depth = 1. /4.2/
4.2 m./4.2/bootable
120 K./4.2/libnativehelper
282 m./4.2/Packages
88 m./4.2/Development
19 Gbit/s/4.2/out
53 m./4.2/hardware
18 m./4.2/bionic
9.1 Mbit/s/4.2/System
138 m./4.2/CTS
336 K./4.2/PDK
116 K./4.2/Abi
5.1 m./4.2/gdk
40 Mbit/s./4.2/libcore
4.9 Mbit/s./4.2/build
34 m./4.2/tools
43 m./4.2/Device
7.5 GB./4.2/. Repo
55 m./4.2/SDK
5.9 m./4.2/docs
41 m./4.2/Dalvik
31 Mbit/s/4.2/ndk

According to the official documentation, install the required tools Python 2.5 -- 2.7 and python. orggnu make 3.81 -- 3.82, GNU. orgjdk 6: 2.3 or later; JDK 5 2.2 or earlier. more than 1.7. the first two Ubuntu 12.10 systems are provided (the benefits of the new system). Git will be installed later through the installation package, so we only need to manually install JDKInstall necessary compilation kits

$ Sudo apt-Get install Git-core GnuPG flex bison gperf build-essential \ zip curl libc6-dev libncurses5-dev: i386 x11proto-core-dev \ libx11-dev: i386 libreadline6-dev: i386 libgl1-mesa-glx: i386 \ libgl1-mesa-dev g ++-multilib mingw32 openjdk-6-jdk tofrodos \ Python-markdown libxml2-utils javastproc zlib1g-dev: i386 $ sudo ln-S/usr/lib/i386-linux-gnu/MESA/libgl. so.1/usr/lib/i386-linux-gnu/libgl. SOPs: Later You can choose not to install openjdk here. Jdk1.6 is used for Android generation.Install JDK 1.6.0

1. Download, The latest version is 1.6.0 _ 38


Here Please select a 64-bit Linux version, the corresponding download file name: jdk-6u38-linux-x64.bin. 2. InstallationModify file permissions, copy to/usr/lib/JVM, install chmod A + x jdk-6u38-linux-x64.bin
Sudo MV jdk-6u38-linux-x64.bin/usr/lib/JVM
After sudo./jdk-6u38-linux-x64.bin installation, in/usr/lib/JVM will have a directory (jdk1.6.0 _ 38), in fact, the execution of the. binfile is a decompression File 3. Environment Configuration

Modify the/etc/profile file export java_home = "/usr/lib/JVM/jdk1.6.0 _ 38"
Export Path = $ path: $ java_home/bin
Export classpath = ".: $ java_home/bin" we recommend that you restart or log out of the system to make the configuration take effect ~~~ Enter JAVA -- version to check the Java version "1.6.0 _ 38"
Java (TM) se Runtime Environment (build 1.6.0 _ 38-b05)
Java hotspot (TM) 64-bit server VM (build ipv13-b02, mixed mode) If openjdk is installed in the system sometimes, we need to modify the Java default program, run the following command to compile and install Java/javac/jar in Android: sudo Update-alternatives -- install/usr/bin/Java/usr/lib/JVM/jdk1.6.0 _ 38/bin/Java 300
Sudo Update-alternatives -- install/usr/bin/javac/usr/lib/JVM/jdk1.6.0 _ 38/bin/javac 300
Sudo Update-alternatives -- install/usr/bin/Jar/usr/lib/JVM/jdk1.6.0 _ 38/bin/jar 300

After the three commands are executed, resources on the Internet can be automatically switched to jdk1.6.0 _ 38, but cannot be configured. The following three commands may be used, manually specified sudo Update-alternatives -- config Java
Sudo Update-alternatives -- config javac
Sudo Update-alternatives -- config jar

Download Code:

Download Repo, initialize the download environment, configure Repo, and synchronize $ mkdir ~ /Bin
$ Path = ~ /Bin: $ path
$ Curl> ~ /Bin/Repo
$ Chmod A + x ~ /Bin/Repo
$ Mkdir ~ /Android/sources
$ Cd ~ /Android/sources
$ Repo init-u android-4.2.1_r1
$ Repo sync downloading is a long process. My host is on for download one weekend ~~~ Good lucky ~~~Compile the Code:Initialize the script and make it to compile $ source build/envsetup. Sh.
$ Lunch full-Eng
$ Make-JN refer to the official documents for the three commands here, which are described in detail on the official website. In particular, the second command parameter, you want to generate what kind of configuration, Set what kind of parameter emulator

After compilation, run the simulator $ emulator...

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: 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.