android系統的源代碼獲取(親測可用)

一、在線閱讀各版本源代碼:
http://androidxref.com/
二、下載到本地:
http://blog.csdn.net/yin1031468524/article/details/55053550

一、下載安裝repo 工具html

  1. mkdir ~/bin  
  2. PATH=~/bin:$PATH  
  3. curl https://storage-googleapis.proxy.ustclug.org/git-repo-downloads/repo > ~/bin/repo  
  4. chmod a+x ~/bin/repo  
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage-googleapis.proxy.ustclug.org/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

二、創建一個放android源碼的目錄,名字隨意android

 

  1. mkdir android_sourcecode  
  2. cd android_sourcecode  
mkdir android_sourcecode
cd android_sourcecode

三、初始化repo庫git

 

  1. repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest  
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest

四、若是須要下載某個特定的android版本,只需經過 -b指定版本號就行api

 

  1. repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-7.1.1_r22  
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-7.1.1_r22

五、repo庫初始化後,就能夠直接下載指定版本的android源碼,也能夠經過指定下載路徑,來下載源碼中某一個模塊curl

  1. #下載repo庫裏全部的android源碼  
  2. repo sync   
  3. #指定下載路徑,下載某個模塊代碼  
  4. repo sync packages/providers/ContactsProvider  
#下載repo庫裏全部的android源碼
repo sync 
#指定下載路徑,下載某個模塊代碼
repo sync packages/providers/ContactsProvider

 

repo sync命令後接的path,在執行repo init目錄下(此處即android _sourcecode)有個.repo文件夾,能夠經過ide

.repo/manifest.xml 查看各個模塊的路徑,而後經過repo sycn path來下載學習最新的android源碼,查看googel大神們寫的代碼工具

若是之後android源碼更新了,只需改變步驟4中-b後指定的路徑,Android全部版本列表學習

相關文章
相關標籤/搜索