Android is the advantage of open source, mobile phones and tablet manufacturers can customize their own mobile phone products according to their own hardware, such as Xiaomi, Le phone, M9, etc., so in the Android source customization, it is necessary to understand the Android pair compilation process. Google's official compilation process simply tells the user how to compile a common system.
Download and compile the Android system, Google's official web site has given detailed instructions, please refer to the website of Android: Http://source.android.com/source/index.html. The main contents are:
(1) Prepare the Android download and compilation environment.
(2) Download the source code.
(3) Compile source code and kernel source code.
Android Source compiled Google only gives the Unix-like system, exactly the Ubuntu and MacOS on the detailed process. using Ubuntu12.04 as a compiled host system, since the code in the Android system is mostly written in the Java language, the JDK must be installed, but different versions have different requirements for the JDK version. In Gingerbread (2.3.x) and later versions, JDK6.0 is used and compiled with 64-bit systems. In previous versions of Gingerbread (2.3.x), JDK5.0 was used and could be compiled on 32-bit systems. For the hardware environment, to have a fast enough PC, if there are conditions, it is best to use the physical PC. Memory is at least 1GB and hard disk must be at least 30GB. Virtual machine software such as VMware or VirtualBox can also be used, but the compilation speed is too slow, and if the memory is less than 1GB, errors may occur when compiling the system.
JDK6.0 recommends downloading directly from the Sun Company's website, with its web site http://java.sun.com/javase/downloads/.
Download Android4.0 and Goldfish source code:
(1) Download and initialize the repo tool: Download the repo tool with the Curl command, add execute permission to the Repo tool, create the source directory, initialize the Repo tool, prepare to access the Google source repository, ensure that Ubuntu is able to surf the internet and connect to the Android server properly. After initializing the Repo tool, you will be prompted to enter your Gmail email and username verification.
(2) Download Android source code: $repo SYNC-JN
(3) Other source code download: www:linaro.org
(4) Download simulator goldfish kernel Source: While developing Android, Google has developed a simulator for each version using QEMU, which greatly reduces developer costs and facilitates the promotion of Android technology. QEMU is an open source emulator software, and Google uses QEMU to simulate the Arm936ej-s goldfish processor, if the developer in the absence of the target Development Board, want to operate the hardware Android low-level driver, you can use the emulator's kernel source code.
Compile Android and goldfish kernel source code:
(1) Compile Android Source: Initialize the environment: switch to the Android source directory $CD working_directory execute the following command, load the command used in the compilation process, environment variables: $ source build/envsetup.sh
(2) Select compilation Options $ lunch
(3) Pre-compilation preparation
(4) Compile source $ make–jn
(5) Compile the goldfish kernel source code: Specify the GCC cross compiler, directly using the android arm-eabi-4.4.3 compiler, it working_directory/prebuilt/linux-x86/toolchain/ The Arm-eabi-4.4.3/bin path.
Android compilation process Analysis. Google gives the following steps for compiling:
(1) Source build/envsetup.sh: Load command.
(2) Lunch: Select the target platform compilation option.
(3) Make: Perform compilation
This section describes the general compilation process for compiling Android systems, and after analyzing the compilation process and configuration files, it focuses on the Android system compilation and custom phone simulator ROM under the Special East platform.
Download and compile the source code