Android 原始碼下載

LiuYinChina發表於2013-08-27

Android 下載說明,https://source.android.com/source/downloading.html

Android 版本檢視,https://android.googlesource.com/platform/manifest/+refs

------------------------------------------

修改 hosts 檔案(新增相關 IP)

Linux,   /etc/hosts
Windows, C:\WINDOWS\system32\drivers\etc\hosts

------------------------------------------

sudo apt-get install curl

mkdir ~/android
curl http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo > ~/android/repo
chmod a+x ~/android/repo
export PATH=~/android:$PATH

cd ~/android
./repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.0_r1

sh -c "echo \"
#!/bin/bash

result=1
while [ $result -ne 0 ]
do
    echo \"========== start repo sync ==========\"
    ./repo sync -j16
    result=$?
    sleep 1
done\" > ~/android/src_sync"; chmod a+x ./src_sync; ~/android/src_sync;

sudo sysctl -w net.ipv4.tcp_window_scaling=0

~/android/src_sync

呼叫 src_sync 時,出現“fatal: '../platform/abi/cpp.git' does not appear to be a git repository”,
(參考 http://zxquiet.iteye.com/blog/1470991 和 http://bbs.csdn.net/topics/380254094)

sed -i "s/fetch=\"..\"/fetch=\"git:\/\/Android.git.linaro.org\/\"/g" ~/android/.repo/manifest.xml

~/android/src_sync

相關文章