Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
180 views
in Technique[技术] by (71.8m points)

"android update sdk" on headless linux

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)

Update: The question was asked a while ago when headless update wasn't supported. It is now possible to do just a android update sdk --no-ui. Thanks folks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use the --no-ui option:

android update sdk --no-ui

If you'd like to automate it, you could accept all licenses by using the expect tool with this hack (the --accept-license option is currently not fully integrated in the android tool):

expect -c '
set timeout -1;
spawn android - update sdk --no-ui;
expect {
    "Do you accept the license" { exp_send "y
" ; exp_continue }
    eof
}
'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...