linux下配置android sdk

该文章介绍下如何在linux中配置android sdk

一、下载android sdk

下载SDK,下载地址:http://developer.android.com/sdk/index.html,选择Linux(i386)。因为SDK只有32位的,如果装的是64位系统,则要安装ia32-libs,运行32位程序。安装命令:sudo apt-get install ia32-libs(在Ubuntu中的命令)。下载完成后解压,在终端进入到SDK的根目录,然后执行:tools/android update sdk –no-ui即可开始和windows里面一样的更新。

[root@app-server1 tools]# android update sdk --no-ui
Refresh Sources:
  Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml
  Validate XML
  Parse XML
  Fetched Add-ons List successfully
  Refresh Sources
  Fetching URL: https://dl-ssl.google.com/android/repository/repository-6.xml
  Validate XML: https://dl-ssl.google.com/android/repository/repository-6.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/repository-6.xml
  Fetching URL: https://dl-ssl.google.com/android/repository/addon.xml
  Validate XML: https://dl-ssl.google.com/android/repository/addon.xml
  Parse XML:    https://dl-ssl.google.com/android/repository/addon.xml
  Fetching URL: http://dl.htcdev.com/sdk/addon.xml
  Validate XML: http://dl.htcdev.com/sdk/addon.xml
  Parse XML:    http://dl.htcdev.com/sdk/addon.xml
  Fetching URL: http://software.intel.com/sites/landingpage/android/addon.xml
  Validate XML: http://software.intel.com/sites/landingpage/android/addon.xml
  Parse XML:    http://software.intel.com/sites/landingpage/android/addon.xml
  Fetching URL: http://www.echobykyocera.com/download/echo_repository.xml
  Validate XML: http://www.echobykyocera.com/download/echo_repository.xml
  Parse XML:    http://www.echobykyocera.com/download/echo_repository.xml
  Fetching URL: http://developer.lgmobile.com/sdk/android/repository.xml
  Validate XML: http://developer.lgmobile.com/sdk/android/repository.xml
  Parse XML:    http://developer.lgmobile.com/sdk/android/repository.xml
  Fetching URL: http://android-sdk-addons.motodevupdate.com/addons.xml
  Validate XML: http://android-sdk-addons.motodevupdate.com/addons.xml
  Parse XML:    http://android-sdk-addons.motodevupdate.com/addons.xml
  Fetching URL: http://innovator.samsungmobile.com/android/repository/repository.xml
  Validate XML: http://innovator.samsungmobile.com/android/repository/repository.xml
  Parse XML:    http://innovator.samsungmobile.com/android/repository/repository.xml
  Fetching URL: http://developer.sonymobile.com/edk/android/repository.xml
  Validate XML: http://developer.sonymobile.com/edk/android/repository.xml
  Parse XML:    http://developer.sonymobile.com/edk/android/repository.xml
Installing Archives:
  Preparing to install archives
  Downloading Android SDK Platform-tools, revision 11
  Installing Android SDK Platform-tools, revision 11
  Stopping ADB server failed (code -1).
    Installed Android SDK Platform-tools, revision 1199%)
  Downloading Documentation for Android SDK, API 15, revision 2
  Installing Documentation for Android SDK, API 15, revision 2
    Installed Documentation for Android SDK, API 15, revision 297%)
  Downloading SDK Platform Android 4.0.3, API 15, revision 3
  Installing SDK Platform Android 4.0.3, API 15, revision 3
    Installed SDK Platform Android 4.0.3, API 15, revision 396%)
  Downloading SDK Platform Android 4.0, API 14, revision 3
  Installing SDK Platform Android 4.0, API 14, revision 3
    Installed SDK Platform Android 4.0, API 14, revision 396%)
  Downloading SDK Platform Android 3.2, API 13, revision 1
  Installing SDK Platform Android 3.2, API 13, revision 1
    Installed SDK Platform Android 3.2, API 13, revision 198%)
  Downloading SDK Platform Android 3.1, API 12, revision 3
  Installing SDK Platform Android 3.1, API 12, revision 3
    Installed SDK Platform Android 3.1, API 12, revision 398%)
  Downloading SDK Platform Android 3.0, API 11, revision 2
  Installing SDK Platform Android 3.0, API 11, revision 2
    Installed SDK Platform Android 3.0, API 11, revision 298%)
  Downloading SDK Platform Android 2.3.3, API 10, revision 2
  Installing SDK Platform Android 2.3.3, API 10, revision 2
    Installed SDK Platform Android 2.3.3, API 10, revision 298%)
  Downloading SDK Platform Android 2.2, API 8, revision 3
  Installing SDK Platform Android 2.2, API 8, revision 3
    Installed SDK Platform Android 2.2, API 8, revision 399%)
  Downloading SDK Platform Android 2.1, API 7, revision 3
  Installing SDK Platform Android 2.1, API 7, revision 3
    Installed SDK Platform Android 2.1, API 7, revision 399%)
  Downloading SDK Platform Android 1.6, API 4, revision 3
  Installing SDK Platform Android 1.6, API 4, revision 3
    Installed SDK Platform Android 1.6, API 4, revision 399%)
  Downloading SDK Platform Android 1.5, API 3, revision 4
  Installing SDK Platform Android 1.5, API 3, revision 4
    Installed SDK Platform Android 1.5, API 3, revision 499%)
  Downloading Samples for SDK API 15, revision 2
  Installing Samples for SDK API 15, revision 2
    Installed Samples for SDK API 15, revision 296%)
  Downloading Samples for SDK API 14, revision 2
  Installing Samples for SDK API 14, revision 2
    Installed Samples for SDK API 14, revision 296%)
  Downloading Samples for SDK API 13, revision 1
  Installing Samples for SDK API 13, revision 1
    Installed Samples for SDK API 13, revision 195%)
  Downloading Samples for SDK API 12, revision 1
  Installing Samples for SDK API 12, revision 1
    Installed Samples for SDK API 12, revision 195%)
  Downloading Samples for SDK API 11, revision 1
  Installing Samples for SDK API 11, revision 1
    Installed Samples for SDK API 11, revision 195%)
  Downloading Samples for SDK API 10, revision 1
  Installing Samples for SDK API 10, revision 1
    Installed Samples for SDK API 10, revision 195%)
  Downloading Samples for SDK API 8, revision 1
  Installing Samples for SDK API 8, revision 1
    Installed Samples for SDK API 8, revision 196%)
  Downloading Samples for SDK API 7, revision 1
  Installing Samples for SDK API 7, revision 1
    Installed Samples for SDK API 7, revision 196%)
  Downloading Android Support, revision 8
  Installing Android Support, revision 8
    Installed Android Support, revision 891%)
  Downloading Google AdMob Ads SDK, revision 6
  Installing Google AdMob Ads SDK, revision 6
    Installed Google AdMob Ads SDK, revision 694%)
  Downloading Google Analytics SDK, revision 2
  Installing Google Analytics SDK, revision 2
    Installed Google Analytics SDK, revision 292%)
  Downloading Google Play APK Expansion Library, revision 1
  Installing Google Play APK Expansion Library, revision 1
    Installed Google Play APK Expansion Library, revision 178%)
  Downloading Google Play Billing Library, revision 2
  Installing Google Play Billing Library, revision 2
    Installed Google Play Billing Library, revision 284%)
  Downloading Google Play Licensing Library, revision 2
  Installing Google Play Licensing Library, revision 2
    Installed Google Play Licensing Library, revision 272%)
  Downloading Google Web Driver, revision 2
  Installing Google Web Driver, revision 2
    Installed Google Web Driver, revision 299%)
  Downloading Android SDK Tools, revision 19
  Installing Android SDK Tools, revision 19
    Installed Android SDK Tools, revision 1999%)
  Downloading ARM EABI v7a System Image, Android API 15, revision 2
  Installing ARM EABI v7a System Image, Android API 15, revision 2
    Installed ARM EABI v7a System Image, Android API 15, revision 299%)
  Downloading Intel x86 Atom System Image, Android API 15, revision 1
 ………(下面省略)………

上面更新的过程中一些特殊的SDK是需要用户名和密码的,如:摩托罗拉和HTC。

我们到这些官网注册一下即可,摩托罗拉和HTC的网址:

注册官网:http://htcdev.com/ 这个是HTC的;具体的注册过程我就不多说了,要是看不懂的大家直接在线翻译一下就可以了

另外一个:https://developer.motorola.com/ 这个是MOTO的,也是一样的需要注册一下,方法同上面的HTC的一样

二、配置环境变量

更新完成后配置环境变量。使用命令 vi /etc/profile 编辑文件profile,然后在下面增加下面内容:

export ANDROID_HOME=/opt/softwaretools/android-sdk-linux

export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH

/opt/softwaretools/android-sdk-linux为SDK的根目录。

这个配置之后,以后要执行android里面的命令,就不是需要进到这个目录,直接可以在终端里面输入。

修改完成后,使用命令 :wq! 保存关闭文件,再执行命令 source /etc/profile 使配置生效一下。

在终端输入:android,如果Android SDK Manager窗口出来了,就证明环境配置成功。

------------------------------------------------------------------------------------------------------------------------------------------

参考资料:http://blog.csdn.net/maylian7700/article/details/7538176

时间: 2024-10-31 20:24:00

linux下配置android sdk的相关文章

在linux下配置DNS服务器的方法

有两台邮件服务器分别为192.168.1.1(windows下主机名为b.test.cn)和192.168.1.3(linux下主机名为a.test.com). 在linux下配置DNS服务器,下面是配置过程中设置过的一些文件, /etc/hosts 文件的具体内容如下: # Do not remove the following line, or various programs# that require network functionality will fail.127.0.0.1 l

在Linux下配置最新APache Web服务器和MySql数据库服务器

问题描述 在Linux下配置最新APacheWeb服务器和MySql数据库服务器.要求:1.将配置过程详细记录2.用配置好的系统编写一个java给予MySql数据库的程序

在linux下配置nexus后启动出错

问题描述 在linux下配置nexus后启动出错 Running Nexus OSS... wrapper | --> Wrapper Started as Console wrapper | Launching a JVM... wrapper | JVM exited while loading the application. jvm 1 | Exception in thread "main" java.lang.UnsupportedClassVersionError:

在linux下配置Redhat9+Apache+Mysql+PHP+GD2+Perl

在linux下配置Redhat9+http://www.aliyun.com/zixun/aggregation/14417.html">Apache+Mysql+PHP+GD2+Perl,安装文章的步骤,相信你完全可以配置你的系统 安装环境描述 操作系统:Linux RedHat AS4.0 web服务软件:Apache httpd-2.2.4下载:http://www.apache.org 数据库软件:mysql-5.0.37.tar.gz 下载:http://www.mysql.co

Linux下配置Shadowsocks服务器的步骤详解

说明: Shadowsocks是一个轻量级的socks5代理软件, 而hadowsocks-libev是一个基于shadowsocks 协议的socks5代理软件, 相比原版,hadowsocks-libev程序体积小.高并发.资源占用更少.跨平台.完全兼容shadowsocks协议. hadowsocks-libev包括三个模块: ss-server:服务器端,部署在远程服务器,提供shadowsocks服务. ss-local:客户端,提供本地socks5协议代理. ss-redir:客户端

linux下配置jsp环境_简单教程

linux下配置jsp环境   180 元  ★钻石信誉★新网域名注册 中文.cn 中文.中国 ★钻石信誉★新网域名注册 中文.cn 中文.中国     今天我在Redhat Linux(Red Hat Enterprise Linux 4)下配置成功了JSP的开发环境,自己一点经验,共享一下. 操作系统:Redhat Linux(Red Hat Enterprise Linux 4) JDK: j2sdk-1_4_2_01-linux-i586.bin TOMCAT: jakarta-tomc

如何使ADB在Linux下支持Android设备的udev规则配置

1.Connect Andriod device to your Linux ***. 2.Use "lsusb". Use lsusb to check the Android device ID in usb subsystem, like below (do not care "$"):   $ lsusb   Bus 001 Device 002: ID 0fce:6156 Sony Ericsson Mobile Number "0fce&quo

Linux系统下安装android sdk的方法步骤

本文阐述的是如何在Linux系统中安装Android SDK 环境,下面话不多说,来看看详细的介绍吧. 直接下载解压: wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz 修改对应的版本号即可. 关于后续的sdk更新,可以使用命令行版本的sdkmanager 直接更新到最新的sdk: tools/android update sdk --no-ui 显示所有的sdk版本 android list sdk --all 会得

零基础学习教程之Linux下搭建android开发环境_Android

不得已重新配置,这里记下详细步骤,分享给大家. 一.安装jdk,具体步骤如下: 1.将jdk-7u4-linux-i586.tar拷贝到linux下得/home/yan/download目录,新建一个目录/home/yan/android.所以和android相关的都安装到/home/yan/android这个目录,所有的源安装文件都放到download下.切换到root,在download目录下输入命令:tar -zxvf  jdk-7u4-linux-i586.tar -C ../andro