下载2.1源码

1.配置环璄
安装jdk
(1)jdk5安装过程(android2.3之前的版本)for Froyo and older
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"
$ sudo apt-get update
$ sudo apt-get install sun-java5-jdk
(2)jdk6安装过程 for Gingerbread and newer
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
安装所需要的开发包
(1)如果是64位系统
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
  x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
  libxml2-utils xsltproc
(2)如果在Ubuntu 10.10下开发
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
(3)如果在Ubuntu 11.10下开发
$ sudo apt-get install libx11-dev:i386
(4)如果是32位操作系统
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
  libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
  libxml2-utils xsltproc
到此环境配置完成



下面是下载源码
1.在主文件中新建bin文件
$ mkdir ~/bin
$ PATH=~/bin:$PATH
2.下载repo
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
3.初始化repo
(1)建立存放android源码的文件目录
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
(2)下载最新版本用
$ repo init -u https://android.googlesource.com/platform/manifest
注:如果想指定某一版本可以用-b
eg:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
4.终端输入repo sync
如果中间中断重新输入就可以了


编译源码
1.初始化
$ source build/envsetup.sh


$ . build/envsetup.sh
2.建一个模拟器
$ lunch full-eng
如果不知道类型直接输入lunch进行选择
3.$ make
这可能要等一段时间
4.启动模拟器
$emulator

你可能感兴趣的:(下载)