问题
So far Ive managed to download and install the SDK and its in my PATH. Problem now is that I can't run "android update sdk" since it expects to be connected to a display and Im connected to a remote headless server through ssh (its a build server so there's no desktop env). Is there a command-line option for the android tool that tells it to run without X ?
回答1:
There is a --no-ui
flag for the update.
Typical linux setup:
cd android-sdk-linux_86/tools
./android update sdk -u
This will run it headless. To note, -u
and --no-ui
are the same flag
回答2:
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
来源:https://stackoverflow.com/questions/2684296/how-to-setup-android-sdk-from-command-line-on-headless-server