android源码编译

http://source.android.com/source/initializing.html

按照步骤来

ubuntu1404 版本别太高。容易 出问题

sudo apt-get install git-core gnupg flex bison gperf build-essential \
 
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
 
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
 
libgl1-mesa-dev libxml2-utils xsltproc unzip


sudo
apt-get install git gnupg flex bison
gperf build-essential zip curl libc6-dev libncurses5-dev:i386
x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386
libgl1-mesa-dri:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos
python-markdown libxml2-utils xsltproc zlib1g-dev:i386 dpkg-de



下载reporepo下载android源码。可以断点续传。源码太大了。中断了又要重来

$ mkdir ~/bin
$ PATH=~/bin:$PATH



$
curl https://storage.googleapis.com/git-repo-downloads/repo
> ~/bin/repo
$
chmod a+x
~/bin/repo
我们使用清华的源
cd
~/bin
gedit
repo
REPO_URL
= 'https://gerrit.googlesource.com/git-repo'
URL修改为
https://gerrit-google.tuna.tsinghua.edu.cn/git-repo


建立工作目录

mkdir-p ~/android/src

cd ~/android/src


repoinit -u https://aosp.tuna.tsinghua.edu.cn/android/platform/manifest-b android-6.0.0_r1


reposync

下载过程中会出现

出现 curl:(22) The requested URL returned error: 404 Not Found Server does notprovide clone.bundle;ignoring. 怎么办?(https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/

  • 无视即可。


等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等

下载完毕



先清理文件

makeclobber

exportUSE_CCACHE=1

sourcebuild/envsetup.sh

lunch

选择1

aosp_arm-eng


make-j8

等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等等

编译完毕

提示

Installsystem fs image: out/target/product/generic/system.img

out/target/product/generic/system.img+maxsize=1644333504 blocksize=2112 total=1610612736 reserve=16610880

####make completed successfully (01:42:58 (hh:mm:ss)) ####



执行emulator开始运行模拟器




你可能感兴趣的:(android源码编译)