Ubuntu搭建Android源码编译环境

一 更新源

1)sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2)sudo gedit /etc/apt/sources.list

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

二 更新下环境
sudo apt-get update

三 libaries need to install:
sudo apt-get install ant ant-optional bison build-essential ca-certificates-java curl flex fusesmb g++-4.4-multilib g++-multilib gcc-4.4-multilib gcc-multilib git-core git-gui gitk gnuit gnupg gperf lib32ncurses5-dev libreadline-gplv2-dev lib32readline-gplv2-dev lib32z1 lib32z1-dev libc6-dev-i386 libesd0-dev libmotif4 libncurses5-dev libsasl2-modules-gssapi-mit libsdl1.2-dev libx11-dev meld menu tsocks valgrind vim x11proto-core-dev zip zlib1g-dev libxml2-utils lib32z1 lib32ncurses5 lib32bz2-1.0

四 JDK install
2.1 JDK 1.6 : copy from other guys
2.2 JDK 1.7: sudo apt-get install java-1.7.0-openjdk
2.2 set envirenment path
export JAVA_HOME=/home/zhang/tools/jdk1.6.0_30
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export JRE_HOME= JAVAHOME/jreexportCLASSPATH=: CLASSPATH: JAVAHOME/lib: JAVA_HOME/jre/lib
export PATH= PATH: JAVA_HOME/bin:$JRE_HOME/bin:~/bin:/home/zhang/tools/adt-bundle-linux-x86_64-20140702/eclipse

五 Set path and repo
git clone git://10.101.2.20/tools/repo.git
mkdir ~/bin
cp repo/repo ~/bin
gedit ~/.bashrc,
将~/bin加入PATH环境变量,添加export PATH=~/bin:$PATH
执行 source ~/.bashrc

六 提交代码 and 配置ssh

你可能感兴趣的:(Ubuntu搭建Android源码编译环境)