[Android] 问题记录 - Ubuntu 下编译Android源码

编译方法参照http://source.android.com/download,目前源码仅提供MacOS,和Linux上的编译。这里主要以ubuntu为例,首先准备系统环境Git/JDK,软件包列表flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl

 

sudo apt-get install git-core gnupg
sudo apt-get install sun-java6-jdk
sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl li b ncurses5-dev zlib1g-dev
sudo apt-get install valgrind

其中的版本要求Python2.4/ JDK 5.0, update 12或更高/ Git 1.5.4

安装Repo

  1. Make sure you have a ~/bin directory in your home directory, and check to be sure that this bin directory is in your path:
    $ cd ~
    $ mkdir bin
    $ echo $PATH
  2. Download the repo script and make sure it is executable:
    $ curl http://android.git.kernel.org/repo >~/bin/repo
    $ chmod a+x ~/bin/repo
  3. Create an empty directory to hold your working files:
    $ mkdir mydroid
    $ cd mydroid
  4. Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest:
    $ repo init -u git://android.git.kernel.org/platform/manifest.git
  5. When prompted, configure Repo with your real name and email address. If you plan to submit code, use an email address that is associated with a Google account.

获取源码

repo sync

修改环境变量

vi /etc/profile

export ANDROID_JAVA_HOME=$JAVA_HOME

开始编译

$ cd ~/mydroid
$ make

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值