1. 访问以下Android官方网站:
http://developer.android.com/sdk/index.html
2. 点击右侧的“Download the SDK”按钮,Ubuntu系统会在按钮上显示"ADT Bundle for Linux"
然后根据系统是32位还是64位下载相应的zip压缩文件。
我下载的最新版本是adt-bundle-linux-x86_64-20130729.zip文件夹,大小为458M.
3.下载完成后解压缩,包含了eclipse和sdk两个文件夹。打开eclipse后,在菜单Window / Preferences,在Preferences对话框中设置Android的SDK Location为刚才下载的sdk目录即可。
此时的eclise即可创建Android工程。
在eclipse的Help菜单,点击第一项Android IDE,然后在弹出的页面点击"New Android Application", 就可以创建自己的App了。
4.更新ADT插件,以及其他版本的SDK
通过以上方法默认只安装了最新版的SDK,目前是4.3
如果想安装其他版本的SDK,可以通过以下方法:
linux系统的话,直接进入刚才下载的sdk/tools目录,运行android文件,就可以弹出下载SDK的对话框。
/adt-bundle-linux-x86_64-20130729/sdk/tools$ ./android
但有可能遇到android更新地址访问不了的情况,此时需要参考以下说明解决:
Android SDK更新以及ADT更新出现问题的解决办法 http://blog.csdn.net/ameyume/article/details/10095825
我是在/etc/hosts文件中追加以下内容解决的:
#Google主页
203.208.46.146 www.google.com
#这行是为了方便打开Android开发官网 现在好像不翻墙也可以打开
74.125.113.121 developer.android.com
#更新的内容从以下地址下载
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
但此时用https还是无法访问的会,提示
Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml, reason: hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com> OR <www.google.com>
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-8.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-8.xml, reason: SSL hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com> OR <www.google.com>
可以修改https为http,或者