使用Cygwin在Windows下取得Android原始碼

來源:互聯網
上載者:User
使用Cygwin在Windows下取得Android原始碼 Windows Android Git Python 防火牆 

使用Cygwin在Windows下取得Android原始碼

 

1、準備Cygwin環境,其中要有curl、wget、python等基本工具。

2、準備源碼存放目錄(如:c:\myeclair),進入Cygwin Shell環境,執行以下命令: Java代碼   // 改變目錄位置到 C:   cd /cygdrive/c/      // 建立存放原始碼的目錄、及repo命令存放的目錄   mkdir myeclair myeclair/bin      //進入原始碼存放目錄   cd myeclair      

3、安裝repo工具,repo是python語言編寫的用於擷取Android原始碼的命令列工具,執行以下命令進行安裝: Java代碼   // 將repo檔案儲存到 bin目錄下   curl http://android.git.kernel.org/repo >bin/repo      //修改repo檔案為可執行檔   chmod a+x bin/repo  

  開啟repo檔案,並修改首行內容:

  把其中REPO_URL=git:// 修改成 http:// (這主要是因為git://協議不能穿過代理服務/防火牆)。

 

4、初始化版本,執行repo命令完成版本庫初始化: Java代碼   // 注意:此處和官方文檔所述方法的不同點在於,git://  --->  http://   // 我們加上了eclair標記   bin/repo init -u http://android.git.kernel.org/platform/manifest.git -b eclair  

備忘: Android各版本及其代號列表:

1.5            cupcake
1.6            donut
2.0/2.1        eclair
2.2            froyo
2.3            gingerbread

 

 

5、同步版本,即真正開始原始碼的下載。首先修改 .repo/manifest.xml 檔案,將其中的 git:// 修改成 http:// 。然後再執行以下命令: Java代碼  

聯繫我們

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