歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 9.10下載安裝Android 2.2 Froyo

Ubuntu 9.10下載安裝Android 2.2 Froyo

日期:2017/2/28 16:32:04   编辑:Linux教程

1 准備開發環境,在Ubuntu下需要安裝的軟件包:
Git 1.5.4 or newer and the GNU Privacy Guard.
JDK 5.0, update 12 or higher.Java 6 is not supported, because of incompatibilities with @Override. //注意JDK版本為5.0
flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.
安裝執行命令如下
$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

另外可以安裝valgrind.用於 find memory leaks, stack corruption, array bounds overflows等等。

在Ubuntu 9.10,直接使用$sudo apt-get install sun-java5-jdk時,安裝java5會安裝不成功,提示沒有找到軟件包。
需要在/etc/apt/sources.list-->“其它軟件”中加入
deb http://cz.archive.ubuntu.com/ubuntu dapper main multiverse
然後安裝
$ sudo apt-get update
$ sudo apt-get install sun-java5-jdk
然後vi .bashrc增加java環境變量
JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH

2 安裝Repo
To install, initialize, and configure Repo, follow these steps:
1. Make sure you have a~/bindirectory in your home directory, and check to be sure that this bin directory is in your path:
$ cd ~
$ mkdir bin
$ echo $PATH
2. Download thereposcript and make sure it is executable:
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo

3 Initializing a Repo client
# Create an empty directory to hold your working files:
$ mkdir mydroid
$ cd mydroid
# 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
* If you would like to check out a branch other than "master", specify it with -b, like:
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake //froyo


4 下載代碼
$ repo sync

5 編譯
$cd ~/mydroid
$make
如果編譯失敗,因為缺少"run-java-tool"
則$export ANDROID_JAVA_HOME=$JAVA_HOME

Copyright © Linux教程網 All Rights Reserved