该文章介绍下如何在Linux下配置Android SDK。
一、下载android sdk
下载SDK,下载地址点击这里,选择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: Validate XML: Parse XML: Fetching URL: Validate XML: Parse XML: Fetching URL: Validate XML: Parse XML: Fetching URL: Validate XML: Parse XML: Fetching URL: Validate XML: Parse XML: Fetching URL: Validate XML: Parse XML: Fetching URL: Validate XML: Parse 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的网址: