综合各个编译Android源代码链接方法
http://blog.csdn.net/luoshengyang/article/details/6559955/
http://www.cnblogs.com/bluestorm/p/4419135.html
http://www.cnblogs.com/qianxudetianxia/p/3681890.html
http://www.cnblogs.com/hoji-real/articles/2144892.html
http://blog.csdn.net/zzsfqiuyigui/article/details/8842359
主要有如下步骤:
1、安装Vmware
2、安装Ubuntu,最新版ubuntu-16.04-desktop-i386
3、准备必要的环境
sudo apt-get install build-essential
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install libc6-dev
sudo apt-get install patch
sudo apt-get install texinfo
sudo apt-get install libncurses-dev
sudo apt-get install git-core gnupg
sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
sudo apt-get install ncurses-dev
sudo apt-get install zlib1g-dev
sudo apt-get install valgrind
sudo apt-get install python2.5
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
如果安装了多个版本的JDk,还需要配置默认版本:
sudo update-alternatives --config java
然后选择默认版本,再配置默认javac版本
sudo update-alternatives --config java
同样进行选择
如果只安装了一个版本的JDK,则无需配置
安装完后执行命令“java -version”查看是否安装成功
5、配置cache
sudo apt-get install ccache
source ~/.bashrc
6、下载repo
创建repo目录
mkdir ~/bin
git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/
将repo文件拷贝到bin目录
mkdir ~/aosp
配置email验证,使用如下命令:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
初始化repo
cd ~/aosp
repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest -b android-5.1.1_r4
7、下载源码
repo sync
http://blog.csdn.net/luoshengyang/article/details/6559955/
http://www.cnblogs.com/bluestorm/p/4419135.html
http://www.cnblogs.com/qianxudetianxia/p/3681890.html
http://www.cnblogs.com/hoji-real/articles/2144892.html
http://blog.csdn.net/zzsfqiuyigui/article/details/8842359
主要有如下步骤:
1、安装Vmware
2、安装Ubuntu,最新版ubuntu-16.04-desktop-i386
3、准备必要的环境
sudo apt-get install build-essential
sudo apt-get install make
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install libc6-dev
sudo apt-get install patch
sudo apt-get install texinfo
sudo apt-get install libncurses-dev
sudo apt-get install git-core gnupg
sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
sudo apt-get install ncurses-dev
sudo apt-get install zlib1g-dev
sudo apt-get install valgrind
sudo apt-get install python2.5
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
如果安装了多个版本的JDk,还需要配置默认版本:
sudo update-alternatives --config java
然后选择默认版本,再配置默认javac版本
sudo update-alternatives --config java
同样进行选择
如果只安装了一个版本的JDK,则无需配置
安装完后执行命令“java -version”查看是否安装成功
5、配置cache
sudo apt-get install ccache
source ~/.bashrc
6、下载repo
创建repo目录
mkdir ~/bin
PATH=~/bin:$PATH
git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/
将repo文件拷贝到bin目录
cp git-repo/repo ~/bin/
REPO_URL = 'git://aosp.tuna.tsinghua.edu.cn/android/git-repo'
mkdir ~/aosp
配置email验证,使用如下命令:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
初始化repo
cd ~/aosp
repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest -b android-5.1.1_r4
7、下载源码
repo sync
时间较长,中间出现错误:Temporary failure in name resolution
修改/etc/resolv.conf中的DNS服务器配置(DNS修改为可用的地址)
nameserver xxx.xxx.xxx.xxx
然后执行network service-manager restart
再重新执行repo sync即可