你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu 13.04下载 编译Android 4.0

[日期:2014-03-06] 来源:Linux社区  作者:u011111270 [字体:大 中 小]

首先参考 http://www.linuxidc.com/Linux/2014-03/97760.htm

Ubuntu 13.04下载Android 4.0.1源码过程  http://www.linuxidc.com/Linux/2013-07/87028.htm

我遇到的困难有一些就在这里解决了。大家可以参看

此前使用XP下硬盘安装的Ubuntu 在下载Android 4.0源码的过程中Ubuntu崩溃,登陆循环 无法解决 故从U盘安装纯Ubuntu。

U盘启动安装Ubuntu 13.04  http://www.linuxidc.com/Linux/2013-04/83525.htm

硬盘安装Ubuntu参考 http://www.linuxidc.com/Linux/2013-10/91565.htm

Ubuntu 就自己安装 不建议使用虚拟机。建议单一系统安装。

下载源码:

首先安装git

sudo apt-get install git-core

然后在HOME 目录下创个文件夹BIN 用来存放 repo

mkdir bin

cd bin

curl http://git-repo.googlecode.com/files/repo-1.12> ~/bin/repo

对repo添加权限

chmod a+x repo

添加环境

PATH=$PATH:~/bin

创建一个文件夹存放源码

mkdir ~/workAndroid

cd ~/workAndroid

后面这个步骤比较重要

用浏览器登录https://android.googlesource.com/new-password,并用gmail帐号登录; 

点击网页上的“允许访问”,得到类似的结果:

machine android.googlesource.com login git-<userName>.gmail.com password <password> 

machine android-review.googlesource.com login git-<userName>.gmail.com password <password> 

 将上边的两行追加到~/.netrc文件结尾。(如果你的linux系统中从来没有建立过此文件,就在home目录下建立.netrc文件,将上面的信息加到新建的文件中去), 

下载地址的URI更改为https://android.googlesource.com/a/platform/manifest。

因为访问基本是匿名的,为了防止连接过多,对同一IP地址的连接数做了一定的限制。用gmail帐号进行认证。 

在公司网络内或者用虚拟机下载的话,会经常遇到这问题。

repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1

如果出现

fatal: unable to auto-detect email address

那么就在终端输入你的邮箱

git config --global user.email "you@example.com"

git config --global user.name "Your Name"

就像这样

现在你的初始化已经成功了。在 repo sync之前 我建议做这一步

打开.repo/manifest.xml。找到下面一段:

<remote  name="aosp"

          fetch=".." />

修改成

<remote  name="aosp"

        fetch="git://Android.git.linaro.org/"/>

相信我 做了这个步骤下载起来飞快 再也不会乱报错了

如果提示这个地址没有链接 可以尝试使用这个:

<remote  name="aosp"

          fetch="https://android.googlesource.com/" />

OK 找个好时间 开始

repo sync

吧

付上一个我正在下载的图

Ubuntu 13.04下载 编译Android 4.0

共勉

编译请看这里Ubuntu 13.04编译Android 4.0

linux
相关资讯       编译Android 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款