tags:

views:

807

answers:

4

Has anybody succeeded in updating/installing Android SDK platforms on a headless Linux server? All I got is the following error:

It seems like the action "update sdk" is actually not supported?

~/android-sdk-linux_86/tools$ ./android --verbose update sdk
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3550 or swt-pi-gtk in swt.library.path, java.library.path or the jar file
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
        at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
        at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
        at com.android.sdkuilib.internal.repository.UpdaterWindowImpl.open(UpdaterWindowImpl.java:93)
        at com.android.sdkuilib.repository.UpdaterWindow.open(UpdaterWindow.java:110)
        at com.android.sdkmanager.Main.showMainWindow(Main.java:281)
        at com.android.sdkmanager.Main.doAction(Main.java:251)
        at com.android.sdkmanager.Main.run(Main.java:92)
        at com.android.sdkmanager.Main.main(Main.java:81)
A: 

you will not be able to as it requires the UI..

Fred Grott
+2  A: 

Yes, it works but you need the GUI libraries installed and you need your DISPLAY set to what X server you want it to display. I have it working now on CentOS 5.4 and had to use the "Server - GUI" verse "Server" install option. Then I just use "ssh -X" from the system where I want it to display.

Jason
can you provide a more concrete example?
Matthias
+2  A: 

Hello focuser. I just ran into the same problem. I found a workaround though.

The first one is a cop-out: Download the platforms on a headed system and simply copy the platform subdirectories into your android sdk/platforms dir.

If, like me, you don't have immediate access to another headed android dev environment, you can go to Google's SDK archives and download one of the other SDK's that included the platforms. This way means that you can only develop for Android 1.1 and 1.5 though.

The download to get for linux systems is their Android 1.5 r3. Of course, google's sdk download pages aren't lynx-friendly, so I had to get the direct link from another GUI system.

wget http://dl.google.com/android/archives/android-sdk-linux_x86-1.5_r3.zip

Then it's simply a matter of unzipping the archive, and moving the platform sibdirs to your newer SDK platform dir.

android create avd -t 3 -p path/to/avd/dir -n "name"

This creates an AVD for the 1.5 platform with your specified name and directory. Note that the avd dir shouldn't exist. If you want to overwrite, add --force to the command.

Getting this far has a platform installed and creates an AVD. Unfortunately, trying to build failed at this point for me because I run a 64bit server, and google only releases 32bit tools.

I found a solution for this in the accepted answer of this stackoverflow question and used sudo apt-get install ia32-libs to enable the ability to run the 32bit tools.

Then you should be able to use the android tool on the CLI to either convert an eclipse project (for 1.5 or lower) to have an ant build system, or you can have it create a new project for you to start working on.

Hope this helps!

Marc
+2  A: 

I just created a small command line tool that does the update in any environment (GUI or non-GUI). Didn't have the chance to test it extensively, but as far as I can tell it does what it should.

The command line tool updates a pre-installed base Android SDK with all currently available platforms, add-ons, extras, docs, samples and tools. This should be enough for a build server (I need this for my Hudson CI installation with Maven).

Please go here for more details:

http://code.google.com/p/android-sdk-tool

Cheers,

Aleks

cheetah