Solve the problem of Android SDK not updating (by wall)

Source: Internet
Author: User
Tags android sdk manager

Yesterday when updating the Android SDK, found that developer.android.com was wall, hands do not have agents, and the Android SDK Manager update has a not very good place is, only one machine update is OK, but if there are more than one confidential update, Every machine has to be downloaded again, that efficiency .....


Observed the log discovery

Fetching http://dl-ssl.google.com/android/repository/addons_list-2.xmlFetched Add-ons list successfully

Originally it downloaded a source of List,addons_list-2.xml content as follows, it is easy to see that the list also indicates the various versions, Platform-tools,build-tools ... The source list

<sdk:sdk-addons-list xmlns:sdk= "HTTP://SCHEMAS.ANDROID.COM/SDK/ANDROID/ADDONS-LIST/2" > <sdk:addon-site        > <sdk:url> addon.xml </sdk:url> <sdk:name> Google Inc.         </sdk:name> </sdk:addon-site> <sdk:addon-site> <sdk:url> addon-6.xml        </sdk:url> <sdk:name> Google Inc. </sdk:name> </sdk:addon-site> <sdk:addon-site> <sdk:url> https://dl-ssl.go         Ogle.com/glass/gdk/addon.xml </sdk:url> <sdk:name> Glass Development Kit, Google INC. </sdk:name> </sdk:addon-site> <sdk:addon-site> <sdk:url> extras/in Tel/addon.xml </sdk:url> <sdk:name> Intel HAXM </sdk:name> </sdk:a            Ddon-site> <sdk:sys-img-site> <sdk:url>Sys-img/android/sys-img.xml </sdk:url> <sdk:name> android System Images </s dk:name> </sdk:sys-img-site> <sdk:sys-img-site> <sdk:url> Sys-img/android-wea R/sys-img.xml </sdk:url> <sdk:name> Android Wear System Images &LT;/SDK:NAME&G    T        </sdk:sys-img-site> <sdk:sys-img-site> <sdk:url> Sys-img/android-tv/sys-img.xml </sdk:url> <sdk:name> Android TV System Images </sdk:name> </sdk:sys- img-site> <sdk:sys-img-site> <sdk:url> sys-img/google_apis/sys-img.xml </sdk :url> <sdk:name> Google API add-on System Images </sdk:name> </sdk:sys-img-s        ite> <sdk:addon-site> <sdk:url> sys-img/x86/addon-x86.xml </sdk:url> <sdk:name> Google Inc. (x86 System Images) </sdk:name> </sdk:addon-site></sdk:sdk-addons-list>

In turn, the list is downloaded back , put in the root directory , developer.android.com to US although the wall, but still can be able to download the Thunder back,


===================================================

Now start DIY, thinking is Dl-ssl.google.com,developer.android.com was wall, then write a simple mirror server, the complete Python code is as follows

#!/usr/bin/env python#coding=utf-8# in the celestial interior can not update the Android SDK, only self-built mirror serverimport osimport basehttpserverimport Simplehttpserverclass Simplehandler (Simplehttpserver.simplehttprequesthandler):    def __init__ (self, request, Client_address, server):        simplehttpserver.simplehttprequesthandler.__init__ (self, request, client_address, Server)    def do_get (self):        print "Old_path:", Self.path # Redirect all Uri paths to the root directory, because all the downloaded stuff is in the root directory.        Self.path = Os.path.basename (self.path)        SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET (self) def run (Server_ Class=basehttpserver.httpserver,        handler_class=simplehandler):    server_address = (",")    httpd = Server _class (server_address, Handler_class)    httpd.serve_forever () if __name__ = = ' __main__ ':    run ()
You need to run this script with root privileges, and then add these two in the host

127.0.0.1 developer.android.com127.0.0.1 dl-ssl.google.com
===================================================
Now run the Android SDK manager again and set the force to use HTTP to see what optional update items are available







In the download back of these XML to find the URL you want to download, and then download back with thunder , put it in the root directory


Repository-10.xml This list contains this version of the SDK Platform, take the 4.4.2 I downloaded as an example

    <span style= "color: #ff0000;" ><strong><sdk:platform></strong></span> <!--Generated at Mon Sep 15:22:30 fr Om git_klp-sdk-release @ 1456859-<sdk:revision>4</sdk:revision> <sdk:description>an Droid SDK Platform 4.4.2</sdk:description> <sdk:version>4.4.2</sdk:version> <sdk:api-le Vel>19</sdk:api-level> <sdk:min-tools-rev> <sdk:major>22</sdk:major> & lt;/sdk:min-tools-rev> <sdk:layoutlib> <sdk:api>12</sdk:api> <sdk:rev                ision>1</sdk:revision> </sdk:layoutlib> <sdk:archives> <sdk:archive> <sdk:size>63871092</sdk:size> <sdk:checksum type= "SHA1" >2ff20d89e68f2f53909 81342e009db5a2d456aaa</sdk:checksum> <strong><span style= "color: #ff0000;" ><Sdk:url>android-19_r04.zip</sdk:url></span></strong> </sdk:archive> &LT;/SDK: archives> <sdk:uses-license ref= "Android-sdk-license"/> </sdk:platform>
So fill up the http://dl-ssl.google.com/android/repository/, it's the correct download URL for http://dl-ssl.google.com/android/repository/ Android-19_r04.zip, turn on the Thunder, and then the good things happen

Note that some like http://dl-ssl.google.com/android/repository/sys-img/android/sysimg_x86-18_r01.zip are mended on HTTP// Dl-ssl.google.com/android/repository/sys-img/android/, generally look at the other URLs on that file and you'll know what to make up.



Download the root directory layout of all content as follows



I have downloaded all the packages I need, click Install ...



Finally, don't forget to change the hosts back.


The disadvantages of this approach are:
Manually clawed the XML file for download URL
The advantages are:
Multiple machine updates are very good for the force


Of course if you are in a big company or a company network can .... If this method doesn't apply to you.

Solve the problem of Android SDK not updating (by wall)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.