Android 源码下载

来源:互联网 发布:免费房产中介软件 编辑:程序博客网 时间:2024/06/05 15:42

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

原创粉丝点击