Windows下下載Android源碼

來源:互聯網
上載者:User

 

Android的源碼都是分塊管理的,比如你想看bootloader的源碼

你可以用git執行git clone git://android.git.kernel.org/kernel/lk.git 來複製bootloader的源碼,但是android的模組太多了要是想複製整個Android工程的源碼,這麼一個一個的下就太費勁了,於是google就做了個python的指令碼用來下載整個工程的源碼,但是這個指令碼需要linux環境,如果想在windows下使用我們就必須在windows環境下搭建一個類比的linux環境,這個類比的環境有那麼幾個,可以到網上搜一下,這裡我們用Cygwin來搭建,這個很簡單.

1. 安裝Cygwin

下載 Cygwin ,然後就是一路的下一步(注意:如果第一次安裝,你需要選install from internet

然後就是選安裝位置,還有臨時檔案的位置和串連網路的設定,這些都預設就可以.關鍵的一步是選擇要安裝的庫和程式,以下這幾個是要安裝的:

Net -> curl

Devel -> git,git-completion,git-gui,gitk

Libs -> libreadline6,libiconv2

Editors -> vim

Python -> python

如果不好找,你可以在上面的Search上搜尋.

2.下載Repo

啟動Cygwin,然後cd /bin,切到bin目錄執行curl http://android.git.kernel.org/repo > ./repo下載repo到bin目錄.

chmod a+x repo 賦予它可執行檔許可權.

3.用Repo下載Android源碼

切到使用者目錄

cd ~

建立 放置源碼的目錄(目錄名隨便)

mkdir AndroidSource

cd AndroidSource

設定Repo

Repo init -u git://android.git.kernel.org/platform/manifest.git (這個過程中會讓你輸入一個暱稱和一個gmail郵箱)

抓取 Android 源碼

repo sync (這個時間可能要長一些,跟你的網速有關).

下載 完成後就可以在AndroidSource目錄看到源碼了.

引用:http://www.free-fly.org/cnblog/?p=204

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.