Android的源代码下载教程
16lz
2021-01-24
环境准备
安装ubuntu系统,或者虚拟机
源码下载
- 首先下载 repo 工具
mkdir ~/binPATH=~/bin:$PATHcurl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo## 如果上述 URL 不可访问,可以用下面的:## curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repochmod a+x ~/bin/repo
- 然后建立一个工作目录
mkdir androidcd android
- 初始化仓库命令:
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest## 如果提示无法连接到 gerrit.googlesource.com,可以编辑 ~/bin/repo,把 REPO_URL 一行替换成下面的:## REPO_URL = 'https://gerrit-googlesource.proxy.ustclug.org/git-repo'
编辑
~/bin/repo
文件,执行命令gedit ~/bin/repo
:
- 如果需要某个特定的 Android 版本
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.1.0_r9
- 同步源码树(以后只需执行这条命令来同步)
repo sync
编译相关
cd android //切到android目录下source build/envsetup.shlunch //选择编译版本类型23 //针对不同类型选择序号,我这里选择23 user版make -j32 //全编,-j加快编译速度mmm packages/apps/Helloword/ //单模块编译切换到要编译的目录下 mm -Bmake clean //清除out目录文件
附加
Android源码下载1-转载
Android源码下载2-转载
深入理解 Android 卷1-转载
更多相关文章
- android第一行代码实战篇——一个小错误
- Android(安卓)Material Design控件之CardView
- android anr导出崩溃文件
- android studio3.5.2打包,解决建议使用 "keytool -importkeystore
- Android中的高效率的数据库操作框架----LitePal
- Android配置
- android兼容2.2及以前版本的退出方法
- Android(安卓)(DiskLruCache)硬盘缓存代码实现
- Android(安卓)Studio:Unable to instantiate application com.an