Download the Android SDK components for offline install

Is it possible to download the Android SDK components for offline install without using the SDK Manager? The problem is I am behind a firewall which I have no control over and both sites download URLs seem to be blocked (throws a connection refused exception)

https://dl-ssl.google.com/android/repository/repository.xml

http://dl-ssl.google.com/android/repository/repository.xml

Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Connection refused: connect

Solution 1:

To install android component do following steps

  • Run android sdk manager on offline machine
  • Click on show/hide log window
  • here youu will find all the list of xml files where packages are available

Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
Fetched Add-ons List successfully
Fetching URL: https://dl-ssl.google.com/android/repository/repository-7.xml
Validate XML: https://dl-ssl.google.com/android/repository/repository-7.xml
Parse XML: https://dl-ssl.google.com/android/repository/repository-7.xml

https://dl-ssl.google.com/android/repository/addons_list-2.xml is main xml file where all other package list is available.

lets say you want to download platform api-9 and it is available on repository-7 then you have to do following steps

  • note the repository address and go to any other machine which has internet connection and type following link in any browser

    https://dl-ssl.google.com/android/repository/repository-7.xml

  • Search for <sdk:url>**android-2.3.1_r02-linux.zip**</sdk:url> under the api version which you want to download. This is the file name which you have to download. to download this file you have to type following URI in any downloader or browser and it will start download the file.

    http://dl-ssl.google.com/android/repository/android-2.3.3_r02-linux.zip

    General rule for any file replace android-2.3.3_r02-linux.zip with your package name

  • Once the download is complete,paste downloaded ZIP(or other format for other os) file in your flash/pen drive and paste the zip file at <android sdk dir>/temp (ex:- c:\android-sdk\temp) folder/directory in your offline machine.

  • Now start the SDK manager and select the package which you have paste in temp and click Install package button. Your package has been installed.

  • Restart your eclipse and AVD manager to get new packages.

Note:- if you are downloading sdk-tools or sdk platform-tools then choose the package for OS which is on offline machine(windows/Linux/Mac).

Solution 2:

You can download manually by parsing the XMLs that you see in Android SDK Manager log.
Currently the XMLs are addon_list and repository. These xmls can change over a course of time.

It has the location of the SDKs, you can browse to the link and download directly via browser. These files has to be placed under proper folder, example the files of google APIs has to be placed under add-ons, if you don't know where the files has to go.

Here is something to help you.
The blogpost from my blog to Install Android SDKs offline --> Offline Installation of Android SDK's

Solution 3:

As said, this error usually comes if u stay behind proxy. So to get with this, open IE-Internet options-Connections-LAN settings and take the proxy address. Configure the SDK Manager.exe (settings tab) to that proxy address with port. Check Force Http....

If u have a Proxy script in your LAN settings, copy the address and paste in address bar. Open the downloaded file in notepad. Find your ip address from ipconfig. In the file, go the subnet range in which your ip falls. Eg: isInNet(resolved_ip, "198.175.111.0", "255.255.255.0") will be true for 198.175.111.53 take the return value: after the word PROXY and use this for configuring SDK Manager.

Now the SDK will be downloaded happily.