在下载Android源码的时候,参照Android官方的文档,我的是mac的虚拟机,按照该页面的步骤http://source.android.com/source/initializing.html。Setting up a Mac OS X build environment。

先创建一个40g的硬盘,大小写敏感的,日志的。不用写命令,在mac有ui工具可完成,很方便。

然后

export PATH=/opt/local/bin:$PATH
$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg
  • Edit /opt/local/etc/macports/sources.conf and add a line that says

    file:///Users/Shared/dports

    above the rsync line. Then create this directory:

    $ mkdir /Users/Shared/dports
  • In the new dports directory, run

    $ svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/
  • Create a port index for your new local repository:

    $ portindex /Users/Shared/dports
  • Finally, install the old version of gmake with

    $ sudo port install gmake @3.81

    To increase the cap, add the following lines to your ~/.bash_profile :

    ulimit -S -n 1024



这一切都很顺利,然后下载代码:

$ mkdir ~/bin$ PATH=~/bin:$PATH$ curl https://android.git.kernel.org/repo > ~/bin/repo

这一步,出错了,下载的repo是个not found的文件,直接打开https://android.git.kernel.org/repo,发现确实是not found啊,郁闷,没有repo后面的步骤都无法进行了,再在google搜索类似问题,得到正解,被屏蔽了,不过有个镜像站点,可以用。https://www.codeaurora.org/gitweb/quic/la/

里面可以找到repo,既然android.git.kernel.org被屏蔽,后面使用该地址的都会出错,于是把Repo的REPO_URL改为git://codeaurora.org/tools/repo.git,如下:

#REPO_URL='git://android.git.kernel.org/tools/repo.git'
REPO_URL='git://codeaurora.org/tools/repo.git'

附件是我改好的Repo,可以直接下载使用

现在开始把

$ repo init -u git://android.git.kernel.org/platform/manifest.git

改为

$ repo init -u git://codeaurora.org/platform/manifest.git

即可。

然后

$ repo sync

就行了!

更多相关文章

  1. Android 到ARM versatile PB板移植主要步骤
  2. Android Banner 的简单使用步骤
  3. Android 安装步骤
  4. Android中点击事件之KeyListener实现步骤
  5. Android移植到Asus P535步骤说明
  6. 安装Android SDK和ADT步骤和遇到的问题
  7. android 检查网络连接状态实现步骤
  8. Android上面的百度地图使用步骤

随机推荐

  1. Android(安卓)弹出软键盘android:windowS
  2. Android 多渠道定制化打包
  3. 如何在Android智能手机上捕获数据包
  4. android sdk 安装时无法连接到地址
  5. 《第一行代码(第二版)》学习(二)
  6. android中gravity和layoutgravity的区别
  7. Android入门之Activity的四种启动模式
  8. Android源代码编译脚本
  9. Android 常用控件(四)
  10. Android常用的网路框架