据说dl-ssl.google.com在大陆被强了,伟大的天朝真是不让人活了,解决方法就是修改C:\Windows\System32\drivers\etc\hosts文件。添加一行:
嘿嘿,大功告成啦!!!
PS:补充下,在mac或Linux中,hosts文件所在位置为/etc/hosts,可以使用sudo vim /etc/hosts来编辑。
=====================下载源代码=========================================
严格按照:http://source.android.com/source/downloading.html来做。如果在下载repo遇到问题,看上面的配置。
如果要下载不同的android版本。用repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.3.3_r1
显示这样说明已经在下载:
cts: 100% (134/134), 77.64 KiB, done.
Resolving deltas: 100% (82/82), completed with 50 local objects.
22 145M 22 33.0M 0 0 248k 0 0:10:02 0:02:16 0:07:46 266kFrom https://android.googlesource.com/platform/dalvik
15e631e..288f228 jb-dev -> aosp/jb-dev
d454d96..b6f4e03 jb-mr1-dev -> aosp/jb-mr1-dev
c087108..583e1f6 jb-mr1-release -> aosp/jb-mr1-release
78a9a37..eeae8a8 master -> aosp/master
* [new tag] android-4.2.1_r1 -> android-4.2.1_r1
=====注,以下是转别人的,因为总是这里摘一点,哪里去一点的,不加出处了。往谅解!
遇到的问题1:
Ubuntu10.x用户可尝试如下操作:
1 修改/etc/apt/sources.list文件
把下面内容加到最后面
deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
2 执行下面两个命令
sudo apt-get update
sudo apt-get install git
问题2
如果在repo sync的时候总是提示失败,可使用这个脚本:
#!/bin/bash
echo "======start repo sync======"
repo sync
while [ $? == 1 ]; do
echo "======sync failed, re-sync again======"
sleep 3
repo sync
done
问题3 :fatal: Unable to find remote helper for 'https'
安装git.1.8.2.tar.gz 在:https://code.google.com/p/git-core/downloads/detail?name=git-1.8.2.tar.gz&can=2&q=中
然后 /usr/lib/git-core$ sudo cp git-remote-https /bin
如果完成了,则显示如下:
下载源代码树:
首先,安装Repo
按照如下步骤安装,初始化,配置Repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest
检出一个分支而不是主干,指定 -b:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
$ repo sync
这里就漫长的等待。。。直到同步完毕。