节约纸巾 发表于 2013-8-28 16:30

Android源码下载

51、先安装curl、git工具。   
2、创建一个放android源码的目录。   
$ mkdir ~/Android_src   
$ mkdir ~/bin   
3、下载repo   
$ cd ~/bin   
$ curl http://android.git.kernel.org/repo > ~/bin/repo   
$ chmod a+x ~/bin/repo   
4、将repo工具所在的路径加入环境变量里PATH(/etc/environment/)中。   
或是在使用repo工具时,手动指定repo路径。   
$ cd ~/Android_src   
$ ~/bin/repo init -u git://android.git.kernel.org/platform/manifest.git   
注:可加 -b 指定所要下的版本,如不加则默认为最新版本。   
5、同步代码   
$~/bin/repo sync   
注:这过程比较慢长,一较要2~3个小时(主要由风速决定)   
   
如感觉上述麻烦,可新建如下脚本,只要运行如下脚本一切ok!!!   
#!/bin/sh   
2 ########################################   
# Create ~/Android_src directory   
# Create ~/bin directory   
########################################   
sudo ln -snf /bin/bash /bin/sh   
if [ -z $(which curl ) ] ; then   
    sudo apt-get -y --force-yes --reinstall install curl   
fi   
if [ -z $(which git-core ) ] ; then   
    sudo apt-get -y --force-yes --reinstall install git-core   
fi   
test -d ~/bin || mkdir ~/bin   
   
test -e ~/bin/repo || curl http://android.git.kernel.org/repo > ~/bin/repo   
test -x ~/bin/repo || chmod a+x ~/bin/repo   
   
test -d ~/Android_src || mkdir ~/Android_src   
cd ~/Android_src   
~/bin/repo init -u git://android.git.kernel.org/platform/manifest.git   
~/bin/repo sync   
   

柳儿 发表于 2018-10-19 07:51

谢谢分亭
页: [1]
查看完整版本: Android源码下载