1

I am attempting to add a User Defined Site to a headless installation of the android sdk.

I am able to get selective package updates working. Examples of what I am doing: http://tools.android.com/recent/updatingsdkfromcommand-line

"android update sdk" on headless linux

How to setup Android sdk from command-line on headless server?

This works fine, but I need to load a user-defined site into the sdk. If I load it via the GUI, then the packaged provided by the add-on site will be displayed when you do

./android list sdk

However, I can not find a way to actually add the site to the list of sources without going through the GUI.

The "User Defined Sites" is brought up by selecting Tools->Manage Add-on Sites in the Android SDK Manager and selecting the User Defined Sites tab.

Community
  • 1
  • 1

1 Answers1

7

There is a workaround for this

after testing on a machine with the ui i have found that it created a file called "repositories.cfg"

so all you need to do is to create a file HOME_DIR/.android/repositories.cfg with the content fitting to your needs in my case it was:

count=1
src00=https\://s3.amazonaws.com/android-sdk-manager/redist/addon.xml

The count here is the number of add-on sites you have on the machine.

jjb
  • 3,560
  • 1
  • 21
  • 30
Srgrn
  • 1,770
  • 16
  • 30
  • We found this after much pain, but unfortunately it is not a really effective work-around: You can not always rely on a consistent HOME_DIR on remote jenkins machines. It would be much better if there was a file in the android dist itself we could modify, but I believe the one in HOME is your only option :(. I will accept for now because I believe there is no better workaround. – Benjamin Cooley May 14 '14 at 23:31
  • I actually looked on the source a couple of days back and it seems you can set ANDROID_SDK_HOME and create the .android directory in it as the SDK will first search the ANDROID_SDK_HOME and only than will try other places. – Srgrn May 15 '14 at 09:02
  • That is useful. I will try it on our set up. – Benjamin Cooley May 15 '14 at 18:13