作者:hytyj_989 | 来源:互联网 | 2023-09-14 01:31
本文给大家讲解下如何在Ubuntu11.04环境下使用Eclipse,AndroidSDK和PhoneGap搭建Android开发环境。#1,安装Eclipse和AndroidSD
本文给大家讲解下如何在Ubuntu 11.04环境下使用Eclipse, Android SDK和 PhoneGap搭建Android开发环境。
#1,安装Eclipse 和 Android SDK/PhoneGap所需软件包:
打开终端,输入下面命令完成题目所述过程:
sudo apt-get install openjdk-6-jdk eclipse ruby rubygems ruby-dev libnokogiri-ruby git ant libxml2 libxml2-dev libxslt1-dev
若是64位,还需要安装下面两个软件包:
sudo apt-get install lib32stdc++6 ia32-libs
JDK and Eclipse install guide . http://www.cnblogs.com/likwo/archive/2012/05/14/2499908.html
#2,安装Android SDK
打开网络浏览器,输入地址 http://developer.android.com/sdk/index.html,下载所需的平台(Win,Mac,Linux)的Android SDK版本。我们选择Linux(i386)即可(32位和64位平台皆适用)。
或者,用下面命令下载并解压文件包:
cd ~
wget http://dl.google.com/android/android-sdk_r11-linux_x86.tgz
tar xvfz android-sdk_r11-linux_x86.tgz
由上述命令,我们可得到文件目录 android-sdk-linux_x86 ,现在我们要将$HOME/android-sdk-linux_x86/tools 目录 和 $HOME/android-sdk-linux_x86/platform-tools 目录添加到PATH 路径变量中去:
打开 ~/.profile文件
gedit ~/.profile
添加下面一行内容到该文件末尾:
[...]
PATH="$HOME/android-sdk-linux_x86/tools:$HOME/android-sdk-linux_x86/platform-tools:$PATH"
然后,运行下面命令将上述改动生效:
export
PATH="$HOME/android-sdk-linux_x86/tools:$HOME/android-sdk-linux_x86/platform-tools:$PATH"
现在,启动 Android SDK:
android
下图就是Android SDK所示:
接下来,选择左侧的“ Available packages ”,后选择右侧栏内的“ Android Repository”,选中所有“ Android Repository”组内的软件包,点击“安装所选软件包”即可。接下来选择“接受”,继续安装完毕即可。
若提示“ADB需要重启”时,我们选择“Yes”,重启ADB。
下载完毕后,点击“close”,关闭对话框。
#3,移植Android SDK到Eclipse
若是你用Eclipse创建Android应用,而非命令行下,则我们需要将移植Android SDK到Eclipse。
首先,从“Applications > Programming > Eclipse”,启动Eclipse。
接下来,请各位读者按照原文,自己调试即可@ 继续阅读
原文:http://www.bentutu.com/2011/06/ubuntu-11-04-setting-up-android-sdk/
----------------------------------------------------------------
other method is :
Use this website by Eclipse
https://dl-ssl.google.com/android/eclipse
- Add all the software
- after restart eclipse , it will remind you to add Android SDK , So choose the SDK platform.
- after install it , please modify profile and PAHT .
refer document
http://www.sigma.me/2011/04/29/linux-install-android-sdk.html
http://farlee.info/archives/ubuntu-install-android-sdk-with-eclipse.html
------------------------------------------------------------------------------
ubuntu 64
Ubuntu 64位系统下eclipse运行报错:Failed to get the adb version ...
run this command : sudo apt-get install ia32-libs
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'ia32-libs' has no installation candidate
E: Unable to locate package lib32readline5-dev
E: Unable to locate package lib32z-dev
ia32-libs is in the universe component. It sounds like you don't have this repository enabled.
You need to enable it, either in Software Center -> Software Sources, or by editing /etc/apt/sources.list and uncommenting lines with universe at the end.
Don't forget to do an apt-get update (or press Update in Update Manager)
or
sudo apt-get install libncurses5-dev:i386
Link from :
http://askubuntu.com/questions/81815/cant-install-lib32ncurses5-dev-or-ia32-libs
/****************************/
apt-get update can update your apt download source