Ubuntu 16.04下载、编译Android源码

1.安装git

USER-NAME@MACHINE-NAME:~$ sudo apt-get install git-core gnupg
2.安装Java JDK
 USER-NAME@MACHINE-NAME:~$ sudo add-apt-repository ppa:ferramroberto/java
     USER-NAME@MACHINE-NAME:~$ 
sudo apt-get update
     USER-NAME@MACHINE-NAME:~$ sudo apt-get install sun-java6-jre sun-java6-plugin
     USER-NAME@MACHINE-NAME:~$ sudo apt-get install sun-java6-jdk
      
3.安装依赖包

USER-NAME@MACHINE-NAME:~$ sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
4.下载源码

     4.1下载repo工具。在Ubuntu上执行以下命令:


    
USER-NAME@MACHINE-NAME:~$ wget https://dl-ssl.google.com/dl/googlesource/git-repo/repo
     USER-NAME@MACHINE-NAME:~$ chmod 777 repo
     USER-NAME@MACHINE-NAME:~$ cp repo /bin/
     4.2下载Android最新版本源代码。在Ubuntu上执行以下命令:
     USER-NAME@MACHINE-NAME:~$ mkdir Android
     USER-NAME@MACHINE-NAME:~$ cd Android
     USER-NAME@MACHINE-NAME:~/Android$ repo init -u https://dl-ssl.google.com/dl/googlesource/git-repo/repo
     USER-NAME@MACHINE-NAME:~/Android$ repo sync
5.编译Android源代码
USER-NAME@MACHINE-NAME:~/Android$ make


你可能感兴趣的:(Android)