I. Install the VMWARE+UBUNTU environment, you can choose a new version as far as possible.
Two. Source code download
In the case of a wall now, it is almost impossible to use git to download Android source code directly from Google.
Fortunately found the image of Tsinghua University, the address is as follows:
http://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
Then just follow the tutorial of this site step-by-step operation on it, the main is the following sentence:
refer to Google tutorialsHttps://source.android.com/source/downloading.htmland Willhttps://android.googlesource.com/
use allhttps://aosp.tuna.tsinghua.edu.cn/
orgit://aosp.tuna.tsinghua.edu.cn/aosp/
instead.
can refer to Lao Luo's blog, download the Android source code, pay attention to the inside of the Google address to replace the Tsinghua address
http://blog.csdn.net/luoshengyang/article/details/6559955
Lao Luo's blog is a 2.3 version of the download, so I downloaded the 2.3. So why choose to download the same version as Lao Luo? Because Lao Luo's analysis is really good, every blog is worth studying carefully.
Three. Compiling
CD to Source code directory
. Build/envsetup.sh mainly. There is a space between and build, this is a source command, and after execution, there are a few more commands.
This command executes the source code directory/build/envsetup.sh file, which generally uses the extra choosecombo,mm,mmm command.
MM compiles the current directory, which is generally the CD./xxx/xxx-mm
MMM compiles the specified directory, which is generally so mmm./xxx/xxx
Choosecombo Select compile parameters, general default.
Make compilation
Four. Compilation error
The process of compiling can not be smooth sailing, there will be a variety of errors;
For example, 64-bit environments can not compile 32-bit, or GCC version is too low or too high, there will be a variety of errors.
Therefore, do not be afraid of errors, if there is a compilation error, the general direct error affixed to Baidu search, and then generally have a solution.
After you modify, do the Make
Five. Running the simulator
1. Add the emulator to the environment variable according to Lao Luo's method first
[email protected]:~/android$ export path= $PATH: ~/working_directory/out/host/linux-x86/bin
[Email protected]:~/android$ export android_product_out=~/working_directory/out/target/product/generic
Ps:
Working_directory is my source code save folder, its full path is:/home/android/working_directory, Perhaps everyone's path is different from this.
However, it is best to add these two lines to the. bashrc file in your home directory so that you do not have to enter these two commands again after restarting your computer. That is
CD ~
Vim. BASHRC
After you enter the content, save and restart the virtual machine.
2. Run the emulator boot emulator on the command line, such as:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7A/F3/wKiom1bCwHuzWgx3AAj4NaRdVnI797.png "title=" 1. Simulator start diagram. png "alt=" Wkiom1bcwhuzwgx3aaj4nardvni797.png "/>
Ps:
aosp-Android Open-source Project Android Development source code plan
This article is from the "www.bogo.com" blog, make sure to keep this source http://483181.blog.51cto.com/473181/1742462
1. Android Source code Download compile