android4.0下載問題

來源:互聯網
上載者:User

最近在下載android4.0的代碼,下列操作
下載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 ANDROID_SOURCE
$ cd ANDROID_SOURCE
 擷取git上的android源碼版本
$ repo init -u https://android.googlesource.com/platform/manifest
我們下載最新版
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1
$ repo sync
可加參數: -jx x代表開啟多少個線程來下載源碼

按照 google 的官網設定會出現在下載的時候產生錯誤 從而不能下載,之前Android的代碼是在Linux kernel(android.git.kernel.org)管理,被Kernel踢出來之後,Android源碼現在直接由Google(android.googlesource.com)管理。
用repo/git下載源碼時

發現有錯誤:
DownloadError: android.googlesource.com: <urlopen error [Errno 110] Connection timed out>


在源碼網站 http://source.android.com/source/downloading.html可以瞭解資訊:

Using authentication
By default, access to the Android source code is anonymous. To protect theservers against excessive usage, each IP address is associated with a quota.

When sharing an IP address with other users (e.g. when accessing the sourcerepositories from beyond a NAT firewall), the quotas can trigger even forregular usage patterns (e.g. if many users sync new clients from the same IPaddress within a short period).

In that case, it is possible to use authenticated access, which then usesa separate quota for each user, regardless of the IP address.

The first step is to create a password fromthe password generator andto save it in~/.netrc according to the instructions on that page.

The second step is to force authenticated access, by using the followingmanifest URI:https://android.googlesource.com/a/platform/manifest. Noticehow the/a/ directory prefix triggers mandatory authentication. You canconvert an existing client to use mandatory authentication with the followingcommand:

$ repo init -u https://android.googlesource.com/a/platform/manifest
 
登入https://android.googlesource.com/new-password 用自己註冊郵箱登入,點擊網頁上的“允許訪問”,得到類似
 machine android.googlesource.com login git-<userName>.gmail.com password <password> 
 machine android-review.googlesource.com login git-<userName>.gmail.com password <password>
把上面那段資訊追加到~/.netrc檔案結尾(請檢查目前使用者的許可權, 如果不存在此檔案則自己建立一個)
的URI更改為https://android.googlesource.com/a/platform/manifest(中間加上了“/a”)。
 repo init -u https://android.googlesource.com/a/platform/manifest -b android-4.0.3_r1
 repo sync -j10

 


摘自 zzobin的專欄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.