下载android源码

来源:互联网 发布:php简单工厂模式 编辑:程序博客网 时间:2024/06/01 08:06
建议翻墙跟着官网操作,下载一下源

官网https://source.android.com/source/downloading

Installing Repo

Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, see theDeveloping section.

To install Repo:

  1. Make sure you have a bin/ directory in your home directory and that it is included in your path:

    $ mkdir ~/bin$ PATH=~/bin:$PATH
  2. Download the Repo tool and ensure that it is executable:

    $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo$ chmod a+x ~/bin/repo
下载配置好repo后,创建目录然后sync源码

mkdir android_source2.3

cd android_source2.3

 

mkdir android_source2.3

cd android_source2.3repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.1_r1 #下载android-2.3.1_r1源码#下载哪个分之按个人需求,eg 如下是下载android-7.1.1_r13 的源码,
#repo init -u https://android.googlesource.com/platform/manifest -b android-7.1.1_r13   #下载android-7.1.1_r13源码

repo sync

推荐执行如下shell脚本来替代repo sync

vim auto_repo.sh

---------------------------------
#!/bin/bash
for (( ; ; ))
do
  repo sync -j16   #开更多job去sync代码,当然快慢取决于机器性能和网络
 
  if [ $? == 0 ]; then
    break;
  fi
done

---------------------------------------

chmod a+x auto_repo.sh

./auto_repo.sh


然后执行repo start master --all  #checkout 默认分支为本地master branch

代码下载完了接下来准备开始编译源码,如果你想在本地安装一堆包,配置各种JDK /OPENJDK的那好吧,当我什么都没说,但是如果想摆脱配置编译环境的烦恼,我推荐使用docker来编译android源码,真的是so easy,再也不需要配置环境了。docker编译源码的介绍在如下文。





0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 借了贷款人死了怎么办 贷款实在还不起怎么办 个人贷款还不起怎么办 珠海派出所办事不公平怎么办 改身份证后学籍怎么办? 威海身份证丢了怎么办 车牌轻微变形了怎么办 车牌照丢一个怎么办 小车车牌掉了怎么办 车牌撞变形了怎么办 车牌烂了一块怎么办 机动车牌照丢了怎么办 汽车想换车牌怎么办 机动车前牌照丢失怎么办 汽车后牌照丢失怎么办 机动车扣分超证怎么办 联通香港无服务怎么办 长乐改区 闽侯怎么办 学校代码查不到怎么办 买票没带身份证怎么办 163邮件发错人了怎么办 pos机未到账怎么办 刷卡迟迟不到账怎么办 农行全渠道升级怎么办 手机输入身份证x怎么办 买房子没有社区怎么办 结婚没钱买房子怎么办 假离婚买房子怎么办? 微信怎么办居住证厦门 厦门没有暂住证怎么办居住证 机票上没有登机口怎么办 德国黑工怎么办居留 夏天吹空调感冒怎么办 拖鞋穿着脚臭怎么办 住墨尔本高层着火怎么办 中转航班托运行李怎么办 孩子淋雨感冒了怎么办 出国留学国内手机号怎么办 出国留学移动号怎么办 要出国了手机卡怎么办 去澳洲打工签证怎么办