2

I am working on a cloud based linux server and, sadly, I need to install the android SDK.

It seems that the android SDK developers don't really recognize any OS that does not include a gui, as it seems virtually impossible to get the SDK installed without one.

If anyone can give instructions that can be executed on a red hat family OS with NO GUI I would hugely appreciate that. developer.android.com does not seem to offer any documentation for this at all.

Again, I am on a linux machine (not a mac) and there is no gui. That means running scripts that require a gui is not a good answer for this question. Please don't ask why my linux installation does not have and will never have a gui.

Is it possible to install the android SDK on this machine at all???

I do have the following, but these don't seem to be what I need. Please give me a clue.

[root /]# ls ./opt/android-sdk-linux/docs/sdk
1.0_r1  1.1_r1  1.5_r2  1.6_r1    download.html  index.html  older_releases.html    RELEASENOTES.html  terms_body.html  win-usb.html
1.0_r2  1.5_r1  1.5_r3  api_diff  images         installing  OLD_RELEASENOTES.html  support_api_diff   terms.html

[root /]# ls ./opt/android-sdk-linux/docs/tools/sdk
eclipse-adt.html  ndk  preview  tools-notes.html

2 Answers 2

1

You can make the installation on a machine with a GUI and transfer the files.

But If you want to run the installer on the GUI-less server, you can do it. You will need to install all the libraries required by the installation program. This does not mean installing a GUI, just whatever libraries are required, some of which might be about GUI elements. Run the installation program over an SSH session with remote display (ssh -X, making sure that you have authorized X11 forwarding in the server configuration (/etc/sshd_config containing X11Forwarding yes)).

1

These days, you can use the command-line tool sdkmanager to install Android SDK, as follows:

  1. Download the "commandlinetools 1.0" package as provided on the Android Studio Download Page. A good place to unpack would be /opt/android-sdk/tools/, as it's integrated with the rest of the installation later.

  2. Make the included sdkmanager executable available system-wide:

    sudo ln -s /opt/android-sdk/tools/bin/sdkmanager /usr/local/bin/
    
  3. Check with sdkmanager what Android SDK package are available for installation:

    sdkmanager --list | less -S
    
  4. Use sdkmanager to install desired SDK packages. For example:

    sdkmanager --install "platform-tools" "platforms;android-29" "build-tools;28.0.2"
    
  5. Batch-accept the licences (technique found here):

    yes | sdkmanager --licenses
    

You must log in to answer this question.

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