Android介紹以及源碼編譯---Android源碼下載

來源:互聯網
上載者:User

標籤:

四. Android源碼下載

4.1     安裝repo

  • 在home目錄下建立bin檔案夾
    $ mkdir ~/bin$ PATH=~/bin:$PATH

 

  • 安裝並更改許可權
    $curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo

 

4.2     初始化repo

  • 建立工作目錄(存放源碼)
    $ mkdir Android4.1 $ cd Android4.1

 

  • 初始化Repo獲得最新的原始碼,即主分支原始碼:
    $repo init -u https://android.googlesource.com/platform/manifest

     

  • 尋找其他Branches(在瀏覽器裡面輸入)
    https://android.googlesource.com/platform/manifest/+refs

     

  • 擷取其他分支原始碼
    $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r3

     

4.3     下載Android 源碼 Tree

  • 初始化完成以後,下載源碼,執行:
    $ repo sync

  repo sync支援斷點續傳。如果下載過程中出錯,網路無法串連等情況,處理完異常後,再次執行repo sync即可

也可執行自動下載批處理,下載異常後自動進行repo sync

1 #!/bin/sh2 repo sync3     while [ $? -ne 0 ]4     do5         repo sync6 done

 

  Android下載源碼比較痛苦,串連到伺服器下載代碼時經常異常,即使FQ,下載速度也非常慢。下載源碼通常需要耗費3天~1周,甚至1個月才能斷斷續續全部下載完。

現在有很多在國外的好心人,下載完源碼並壓縮後放到了網上進行共用,我們可以選擇搜尋這些以後的共用,以節省時間。

 

下面介紹:《Android介紹以及源碼編譯---編譯Android源碼》

Android介紹以及源碼編譯---Android源碼下載

聯繫我們

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