Mac下Android源码下载教程

一、Mac默认大小写不敏感, 需要利用磁盘工具创建大小写敏感的映像

  • 进入磁盘工具->文件->新建映像->空白映像(6.0系统编译需要70GB);

  • 创建,如下图:

  • 点击‘存储’完成创建;

二、命令行进入创建的映像

  • 输入命令 hdiutil attach ~/android.dmg -mountpoint /Volumes/android 如下图:
  • 进入路径 cd /Volumes/android 如下图:

三、下载源码,谷歌官网:http://source.android.com/source/downloading.html,国内镜像操作:http://www.tuicool.com/articles/6ZF7Nvy

Installing Repo
  • Make sure you have a bin/ directory in your home directory and that it is included in your path:

      $ mkdir ~/bin
      $ PATH=~/bin:$PATH
    
  • 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
    
Initializing a Repo client
  • Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:

      $ mkdir WORKING_DIRECTORY
      $ cd WORKING_DIRECTORY
    
  • Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.

      $ repo init -u https://android.googlesource.com/platform/manifest
    

    To check out a branch other than "master", specify it with -b. For a list of branches, see Source Code Tags and Builds.

      $ repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.0_r2
    
Downloading the Android Source Tree
  • To pull down the Android source tree to your working directory from the repositories as specified in the default manifest, run

      $ repo sync
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,513评论 2 45
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 8,912评论 0 6
  • 不少新进入职场或者转岗的朋友这在进入工作岗位不久都遇到几个问题: 1、工作从勤杂开始:一般新人都是被重点“照顾的对...
    抱团取暖阅读 2,319评论 0 0
  • 在火车上的夜晚总是难熬的,夜太长,像总也做不完的梦。 这条路,来来回回,总也走不完。 大学三年,有许多遗憾不甘,然...
    浪味小仙人阅读 130评论 0 0
  • 有时候,一直向前跑,不知怎么的,突然觉得自己很SB,开始出现怀疑,自我怀疑。怀疑自己出发是对还是不对,留在原地是不...
    黑熊爱折腾阅读 130评论 0 1