红联Linux门户
Linux帮助

基于Ubuntu 15.04 LTS编译Android5.1.0源代码

发布时间:2015-04-29 15:01:15来源:blog.csdn.net/yuxiangyunei作者:yuxiangyunei

环境:
ubuntu:ubuntu-15.04-desktop-amd64
VMware:VMware-workstation-full-11.1.0-2496824,1F04Z-6D111-7Z029-AV0Q4-3AEH8
android:android-5.1.0_r3


一、Initializing a Build Environment
1.Installing the JDK

$ sudo apt-get update 
$ sudo apt-get install openjdk-7-jdk 

2.Config the JDK

$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-7-openjdk-amd64/bin/java" 1 
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-7-openjdk-amd64/bin/javac" 1 
$ sudo update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/bin/java 
$ sudo update-alternatives --set javac /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 

3.Check the JDK

$ java -version 

or

$ sudo update-alternatives --config java 
$ sudo update-alternatives --config javac 

4.Installing required packages

$ sudo apt-get install bison g++-multilib git gperf libxml2-utils make zlib1g-dev:i386 zip


二、Building the System
1.Initialize

$ source build/envsetup.sh 

2.Choose a Target

$ lunch 20 

3.Update api

$ make update-api 

4.Build the Code

$ make -j 


参考资料:
1. http://source.android.com/source/initializing.html
2. http://blog.csdn.net/gobitan/article/details/24322561
3. http://source.android.com/source/building-running.html


相关文章:
64位ubuntu kylin配置QT for Android://m.ajphoenix.com/linux/11728.html
Ubuntu下Android编译环境搭建://m.ajphoenix.com/linux/11596.html
图解Android源代码下载指南://m.ajphoenix.com/linux/10902.html
Ubuntu下Android源码获取与编译://m.ajphoenix.com/linux/11182.html