ubuntu9.10安裝android SDK
2009-12-11 09:27 Android開發(fā),在 ubuntu 9.10 I386 上安裝SDK ,NDK。
目標(biāo):ubuntu 9.10 上配置 Eclipse 可以調(diào)試 Android SDK , NDK
需要軟件:
Linux ubuntu 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
Eclipse 3.5.1
android-ndk-1.6_r1-linux-x86.zip
android-sdk_r04-linux_86.tgz
ADT 0.95
JDK 1.5 (官方建議1.5版本)
1.install JDK 1.5
ubuntu默認(rèn)安裝 OpenJDK ,我們需要安裝sun-java5-jdk.
換用ubuntu 9.04 source.list
sudo apt-get install sun-java5-jdk
確認(rèn)環(huán)境java -version
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode, sharing)
2.install Eclipse
使用ubuntu 9.10 source.list
sudo apt-get install eclipse
//eclipse-pde will install eclipse-jdt
3.install ADT
eclipse help > software updates
add avaliable software > add site
http://dl-ssl.google.com/android/eclipse > install
可能會(huì)遇到bug ,這個(gè)是bug的解決方案。update 后即可解決。
Bug #482244 in eclipse (Ubuntu): “requires 'org.eclipse.gef 0.0.0' but it could not be found
http://download.eclipse.org/releases/galileo to your update sites and try again.
也就是先add
http://download.eclipse.org/releases/galileo再add
http://dl-ssl.google.com/android/eclipse可以順利完成安裝
4. install Android SDK
download : sdk 1.6
解壓縮 sdk
eclipse >windows> prefences > Android > SDK Location : set the path of the sdk1.6
sudo chmod a+w android-sdk-linux_86 -R
windows > Android SDK and AVD Manager > installed Package > update All >accept > installed accepted
windows > Android SDK and AVD Manager > Virtual Devices > New > target AVD
此時(shí)SDK已經(jīng)安裝完成了。
使用open > project >android project > open exist project ....
5.install NDK
解壓縮 NDK
install NDK : cd $NDKROOT ./bulid/host-setup.sh
可能會(huì)遇到bug , 1.6NDK 中/host-setup.sh 文件 119 行
if [ "$result" == "Pass" ] ; then
改為 if [ "$result" = "Pass" ] ; then
此時(shí)設(shè)置好NDK 。
我們可以測(cè)試下 NDK 1.6
cd $NDKROOT
make APP=hello-jni
make clean APP=hello-jni
Android NDK: Building for application 'hello-jni'
Clean: hello-jni
asus@ubuntu:/opt/android-ndk-1.6_r1$ make APP=hello-jni
Android NDK: Building for application 'hello-jni'
Compile thumb : hello-jni <= apps/hello-jni/project/jni/hello-jni.c
SharedLibrary : libhello-jni.so
Install : libhello-jni.so => apps/hello-jni/project/libs/armeabi
此時(shí),證明NDK 工作正常。
我們可以使用Eclipse > open > project > android > open exits /android-ndk-1.6_r1/apps/hello-jni
而后 run as > Android Application