$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
https://gerrit.googlesource.com/git-repo
# 改为
https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
# 下载源码包
$ wget https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar
$ tar xf aosp-latest.tar
$ cd aosp
$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
$ repo sync
$ cd aosp
$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.1_r1
$ repo sync
-
安装需要的库
$ sudo yum install -y gcc make libstdc++.i686 libstdc++-devel.i686 zlib-devel openssl-devel perl cpio expat-devel gettext-devel autoconf glibc.i686 glibc-devel.i686 zlib-devel.i686 libstdc++.i686 libX11-devel.i686 ncurses-devel.i686 ncurses-libs.i686 gperf flex gcc-c++ bison patch
-
安装java库
$ sudo yum install -y java-1.7.0-openjdk.x86_64 java-1.7.0-openjdk-devel.x86_64 java-1.7.0-openjdk-headless.x86_64
或者
$ sudo yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 java-1.8.0-openjdk-headless.x86_64
-
编译
# source 环境
$ . build/envsetup.sh
# 选择编译项目
$ lunch 2
# 编译,可以使用-j选项设置并行编译的数量
$ make -j8
网友评论