11

I'm trying to setup my Android development environment and for some reason I would rather do that offline instead of using SDK to download the packages. So far I managed to grab a list of packages from google's repository and download them all (5.2 GB in total). Here are what I've got:

android-XX_rXX.zip
build-tools_rXX-linux.zip
docs-22_r01.zip
google_apis-XX_rXX.zip
google_m2repository_r15.zip
google_play_services_3265130_r12.zip
google_play_services_6587000_r22.zip
market_apk_expansion-r03.zip
market_apk_expansion-r03.zip
market_licensing-r02.zip
platform-tools_r22-linux.zip
play_billing_r05.zip
samples-XX_rXX.zip
simulator_r01.zip
sysimg_XXX-XX_rXX.zip
tools_r24.1.2-linux.zip
webdriver_r02.zip

To reduce the size of list I combined its items using X notation. Now that I've got the list I search to find what to do with them next. This post suggests copying them into sdk-folder/temp and run the sdk manager. Which I did but nothing happened! Here's what my sdk manager looks like with having all the packages' zip files in temp folder:

enter image description here

Should I have done anything differently? Is there a way to install packages manually? (There are 70 zip files in total)

2

3 Answers 3

11

of course you can, use below link and Download Offline any package's you need :

http://downloads.puresoftware.org/files/android/

// i think your ip banned from Google.like IRAN Ip :) For Online packages download.

after Download :

Extract Folder, (Example : build-tools ) in : SDK Root Directory. or if doesnt exist with this name, Create a folder with this name ( build-tools ) and then Open Sdk manager and now, you can see Added Package in List.

or you can Download Bundle : All Android Studio Packages (Not Recommended)

and Attend please, this is your SDK Root Directory :

/home/mehran/Application/Android/android-sdk-linux/

Extract all of this packages in this Directory.

also, maybe usefull :

Adding SDK Packages

2
  • Thanks, do you know where sources-XX files should go?
    – Mehran
    Mar 19, 2015 at 9:09
  • 2
    For Sources: download Sources based on your Api, then create a folder in Sdk Root Directory with this name : sources, and extract downloaded folder in this dir, then you can see sources added to SDK.good day. Mar 21, 2015 at 12:11
4

You could consider using https://github.com/icefapper/offdroid; it creates a server on local host and serves the sdk manager with the packages you have on the disk. the process is completely transparent to the sdk manager -- it still believes it is retrieving the packages from the internet.

3

for offline setup, you also need .inf files. each file that you copied, need a .inf file for example file named sysimg_armv7a-15_r03.zip has a file named sysimg_armv7a-15_r03.zip.inf

content of the inf file is like bellow :

### Android SDK Download.
#Mon Jan 25 05:16:36 SGT 2016
StatusCode=206
Last-Modified=Thu, 04 Jun 2015 17\:00\:00 GMT
ETag="55d25"

SDK manager based on these files understand your copy on your temp folder is old or not. the status code determine if the download of the package is failed or succeed. the status code is simple http response code. so in this case it failed. if it's succeed, then it should be 200.

To setup offline:

  1. first you need to select packages that you want to setup.

  2. then press install packages button. in this way the SDK manager will create the .inf files.

  3. then you need to replace .zip files in temp folder
  4. then open each .inf file and replace status code with 200
  5. reload SDK manager and ask to install packages again

in this way, still you need an internet connection so the SDK manager can check the validity of your packages. but at least you can download the packages from any other source or with a download manager to have a faster download speed

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .