您的位置:首页 > 移动开发 > Android开发

mac下面更新Android SDK(解决无法下载)

2014-11-29 13:21 447 查看
在mac机器用android studio下面,点击Manager SDK,一般会卡在:Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
进度条会不动,这里面给一个解决办法:

在文件-->前往->前往文件夹...



输入:/etc/hosts
得到如下图:



将这个文件拷贝出来(放到桌面)并打开,内容如下:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost
fe80::1%lo0	localhost


在这个文件内容末尾追加:

209.116.186.251 www.google.com.hk
209.116.186.251 accounts.google.com
203.208.46.146  www.google.com
74.125.113.121 developer.android.com
203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com
203.208.46.146 https://dl.google.com 203.208.46.146 https://dl-ssl.google.com[/code] 
保存,将这个文件替换原来在
/etc/hosts 的文件。

重新打开Manager SDK既可以发现可以了。

window系统下面情况类似。打开C:\Windows\System32\drivers\etc,以管理员身份编辑hosts文件,在最后添加即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: