Google Nexus5关于Android 6.0源码的同步,编译和烧写

来源:互联网 发布:出色的有声小说 知乎 编辑:程序博客网 时间:2024/05/22 11:40


关于Ubuntu下Android开发的环境搭建这里就不在详述啦,下面所提到的主要是一些关键点,


repo工具的下载和使用

mkdir ~/binPATH=~/bin:$PATHcurl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repochmod a+x ~/bin/repo

如果你已经配好repo请忽略以上步骤。

初始化仓库:

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest# 或 repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest## 如果提示无法连接到 gerrit.googlesource.com,可以编辑 ~/bin/repo,把 REPO_URL 一行替换成下面的:## REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'

如果需要某个特定的 Android 版本(列表):

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.1_r1

同步源码树(以后只需执行这条命令来同步):

repo sync

有兴趣的同学可以去清华镜像站http://mirrors.tuna.tsinghua.edu.cn/help/#AOSP查看

如果顺利的话几个小时就可以把Android M的源码同步下来。

在编译aosp hammerhead也就是Nexus 5源码之前你需要去官方把相关驱动下载下来(如果你只是模拟器体验可忽略此步骤)

官方驱动下载地址:https://developers.google.com/android/nexus/drivers#hammerheadmra58k

如果你无法访问谷歌网站可以从该地址下载http://pan.baidu.com/s/1bnBgdYZ

把这三个文件解压并在根目录运行会自动把相关驱动安装到vendor下面。

做完以上工作就可以编译源码啦。

Building the System

1、

 source build/envsetup.sh
2、

lunch

3、

aosp_hammerhead-userdebug

4、make -j4


编译完成

adb reboot-bootloader

然后fastboot flash boot boot.img

fastboot flash recovery recovery.img

fastboot flash system system.img

fastboot reboot

到此你就可以用Nexus5使用Android6.0开发调试啦。



0 0