Android源碼研究的準備工作 -- 下載android源碼到Ubuntu上(親自調試,不能過分迷信GOOGLE文檔)
參考資料:
https://source.android.com/source/downloading.html#initializing-a-repo-client
https://blog.csdn.net/xjanker2/article/details/4497013
https://www.cnblogs.com/nikyxxx/archive/2011/11/11/2246076.html
https://www.cnblogs.com/yayagepei/articles/2753253.html
核心幾個命令:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
網上或者很多書籍上都是這樣寫的:
curl https://android.git.kernel.org/repo > ~/bin/repo
結果得到的repo不能用,什麼301重定向的,唉!悲催啊!後來在csdn上發了個貼子,大牛給解決啦!
https://code.google.com/p/git-repo/downloads/detail?name=repo-1.12 這個鏈接提供下載repo!
也可以通過下麵命令得到:
curl https://git-repo.googlecode.com/files/repo-1.12 > ~/bin/repo
修改~/bin/repo文件將第五行這一步又是容易出錯啊,哥就死在這裏很久啊!很多書籍或網站上都是這樣命令:
~/bin/repo init -u git://android.git.kernel.org/platform/manifest.git
執行以後,等n久,結果出現讓你喜出望外的結果啊
error:Failed connect to code.google.com:443; Operation now in progress while accessing https://code.google.com/p/git-repo//info/refs
網上大牛解決:修改~/bin/repo文件將第五行
REPO_URL='https://code.google.com/p/git-repo/'
改為
REPO_URL='https://code.google.com/p/git-repo/'
repo升級
$ repo init --repo-url https://android.googlesource.com/tools/repo -u https://android.googlesource.com/platform/manifest -b android-2.3.3_r1
$ repo sync
$ make
這是比較核心的和穀歌文檔不太一樣的地方,抓住這幾個關鍵點,就可以編譯自己的ANDROID源碼了。這幾個文檔可以參考一起看。
我是成功了。
最後更新:2017-04-03 12:55:19