Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ubuntu 14.04 command line install android sdk (platform & platform-tools only, no emulator)
# install java
apt-get install -y software-properties-common
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# download latest android sdk
# http://developer.android.com/sdk/index.html#Other
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
tar -xvf android-sdk*-linux.tgz
cd android-sdk-linux/tools
./android update sdk --no-ui --filter platform,platform-tools
# set path
echo 'export PATH=$PATH:/opt/android-sdk-linux/platform-tools' >> /etc/profile.d/android.sh
echo 'export ANDROID_TOOLS=/opt/android-sdk-linux' >> /etc/profile.d/android.sh
source /etc/profile.d/android.sh
# add i386 support
dpkg --add-architecture i386
apt-get update
apt-get install -y libc6:i386 libstdc++6:i386 zlib1g:i386
# install sdks
cd /opt/android-sdk-linux/tools
./android list sdk --all
./android update -u -t 1,2,4,26,103
# done!
adb connect <IP>
@jobsamuel
Copy link

jobsamuel commented Jan 23, 2016

Thanks! 😃

@MacroMan
Copy link

MacroMan commented Mar 10, 2016

Line 29 ./android update -u -t 1,2,4,26,103 produces an error:
Error: Flag '-u' is not a valid global flag. Did you mean to specify it after the verb/object name?

@jelenajjo
Copy link

jelenajjo commented Jul 17, 2016

@MacroMan I did it successfully with ./android update sdk -t 1,2,4,26,103

@jcravelo
Copy link

jcravelo commented Jul 24, 2016

Thanks, with the sdk is ok, great tutorial.

@ar-g
Copy link

ar-g commented Feb 8, 2017

instead of ./android update -u -t 1,2,4,26,103 should be ./android update --no-ui -t 1,2,4,26,103

@s26
Copy link

s26 commented Mar 8, 2017

I got

./android update -u -t 1,2,4,26,103
Error: Flag '-u' is not a valid global flag. Did you mean to specify it after the verb/object name?



and I have tried ./android update sdk -t 1,2,4,26,103 and I got following

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.sdkmanager.Main.showSdkManagerWindow(Main.java:403)
	at com.android.sdkmanager.Main.doAction(Main.java:369)
	at com.android.sdkmanager.Main.run(Main.java:151)
	at com.android.sdkmanager.Main.main(Main.java:117)

@s26
Copy link

s26 commented Mar 8, 2017

Solved it using ./android update sdk --all

@anoobbava
Copy link

anoobbava commented Apr 5, 2017

help please
./android update sdk --all
java.lang.NullPointerException
at java.io.File.(File.java:277)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1616)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1577)
at com.android.sdklib.internal.avd.AvdManager.(AvdManager.java:350)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:373)
at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:254)
at com.android.sdklib.internal.repository.updater.UpdaterData.(UpdaterData.java:122)
at com.android.sdkuilib.internal.repository.SwtUpdaterData.(SwtUpdaterData.java:61)
at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.(SdkUpdaterWindowImpl2.java:104)
at com.android.sdkuilib.repository.SdkUpdaterWindow.(SdkUpdaterWindow.java:88)
at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:407)
at com.android.sdkmanager.Main.doAction(Main.java:368)
at com.android.sdkmanager.Main.run(Main.java:150)
at com.android.sdkmanager.Main.main(Main.java:116)

@projenix
Copy link

projenix commented May 4, 2017

Thanks a lot!

@CharlesGrimont
Copy link

CharlesGrimont commented Jul 6, 2017

Tanks !

@Logiks
Copy link

Logiks commented Sep 17, 2017

./android update sdk -u -t 1,2,4,26,103

SDK is missing, basically error is that its asking what to update.

@kdahlhaus
Copy link

kdahlhaus commented Nov 6, 2018

sudo apt install libswt-gtk-3-java libswt-gtk-3-jni allowed me to run ./android with the GUI.

@Ethan-Rivas
Copy link

Ethan-Rivas commented May 6, 2020

Update line 29 with:
./android update sdk -u -t 1,2,4,26,103 or all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment