First, the preparatory work:
(1) <a href = http://www.pc6.com/softview/softview_48354.html tiltle = "Download Vm10 url" >vmare Workstation 10</a>
(2) <a href = http://releases.ubuntu.com/12.04/tiltle = "Download Ubuntu12.04 64bit url" >ubuntu12.04 64bit</a>
(3)
<a href = http://www.oracle.com/technetwork/java/javase/index-137561.html#linux Tiltle = "JDk1.6" >jdk1.6 </a >
(4) Android 4.4 Source (PS: Forget to download the place)
(5) After installing ubuntu12.04, set up the software source in Update Source Manager and select Selecet
Best server is good. This is done in order to quickly install the package later.
Second, the environment equipped
1. JDK
(1) in ubuntu12.04 terminal input: <code> mkdir devtool</code>, create a Devtool folder.
Then put the downloaded Jdk-6u45-linux-x64.bin in this folder.
(2) Installation
Enter the Devtool directory, change the permissions of the Jdk-6u45-linux-x64.bin, install.
<code>
CD Devtool <br/>
sudo chmod 777 jdk-6u45-linux-x64.bin<br/>
./jdk-6u45-linux-x64.bin<br/>
</code>
(2) Configuring environment variables
Open the/etc/profile file at the end to add the relevant statement; then activate the file.
<code>sudo gedit/etc/profile</code>
<p>
Export java_home=/home/yun/devtool/jdk1.6.0_45
Export Jre_home= $JAVA _home/jre
Export classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATH
Export path= $JAVA _home/bin: $JRE _home/bin
</p>
<code> source/etc/profile<code>
Reference URL: http://www.cnblogs.com/BigIdiot/archive/2012/03/26/2417547.html
2. Configure the relevant environment
(1) Related software packages
<code>
sudo apt-get install Git-core GnuPG Flex Bison gperf build-essential<br/>
sudo apt-get zip curl Libc6-dev libncurses5-dev:i386 x11proto-core-dev<br/>
sudo apt-get libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386<br/>
sudo apt-get libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos<br/>
sudo apt-get python-markdown libxml2-utils xsltproc zlib1g-dev:i386<br/>
sudo apt-get install lib32readline5-dev<br/>
</code>
The best way to install a line is to install a package that is missing. However, the relevant error prompts, as long as the information prompted to modify the installation can be, OK through.
(2) Setting up a soft connection
<code>
sudo ln-s/usr/lib/i386-linux-gnu/mesa/libgl.so.1/usr/lib/i386-linux-gnu/libgl.so
</code>
(3) Installation of gcc4.4 and g++4.4
Since GCC and g++ are both version 4.6 in ubuntu12.04, our environment is dependent on version 4.4
So it needs to be modified. You can use Gcc–v and g++-V to view the version number.
<code>
sudo apt-get install gcc-4.4<br/>
sudo apt-get install g++-4.4<br/>
sudo apt-get install gcc-multilib<br/>
</code>
After loading, go to the/usr/bin directory to modify the relevant links:
<code>
Cd/usr/bin
sudo mv gcc gcc.bak----backup First gcc-4.6
sudo ln-s gcc-4.4 gcc
sudo mv g++ g++.bak----Backup First g++-4.6
sudo ln-s g++-4.4 g++
</code>
Reference URL: http://blog.163.com/zhou_411424/blog/static/1973621562012810631356/
3. Decompression android4.4.7z Source code
Before unpacking, install a package and set up a Android4.4 folder.
Install unpacking Kit: <code>sudo apt-get Install P7zip-full </code>
Copy the android4.4.7z into the Android4.4, and in the console into the Android4.4, unzip.
<code>
CD Android4.4
7z x android4.4.7z
</code>
4. Compiling
<code>
SOURCE build/envsetup.sh
Make–j4
<code>
After the Make–j4, a long time after compiling, a problem occurred:
WORKAROUND: You need to create a swap partition
<code>
sudo dd if=/dev/zero of=/opt/moreswap bs=1024 count=512k <br/>
sudo mkswap/opt/moreswap <br/>
sudo swapon/opt/moreswap <br/>
sudo gedit/etc/fstab <br/>
/opt/moreswap None swap SW 0 0 <br/>
</code>
Reference URL:
http://blog.csdn.net/leomok1986/article/details/7098114
Then continue compiling: MAKE–J4
5. Compilation Results
6. Running the simulator
Configure the environment variables first:
<code>
sudo gedit/etc/profile
</code>
<p>
Expor path= $PATH:/home/yun/android4.4/out/host/linux-x86/bin
Export Android_product_out=/home/yun/android4.4/out/target/product/generic
</p>
Run: Emulator
Iii. References:
http://blog.csdn.net/oldmtn/article/details/9189509
http://blog.163.com/zhou_411424/blog/static/1973621562012111782412775/
Iv. Summary
Through this Android4.4 source code compiled environment, not to carry the time, everyone's machine environment is different, so all kinds of errors will have. In short, we need to search slowly. Thanks, bloggers who are willing to share. Thank you! :)