"sdkmanager: command not found" after installing Android SDK
On Ubuntu 18.04, the binary sdkmanager
is indeed not included in the apt-package android-sdk
.
This worked for me:
- Install
android-sdk
viaapt
, as you described:
apt-get install android-sdk
- Set environment variable
ANDROID_HOME
if not done yet. For example:
export ANDROID_HOME=/usr/lib/android-sdk
- Download and install the command line tools of Android Studio from https://developer.android.com/studio#downloads. You actually don't need the full Android Studio, just the command line tools.
wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zipunzip commandlinetools-linux-6609375_latest.zip -d cmdline-toolssudo mv cmdline-tools $ANDROID_HOME/export PATH=$ANDROID_HOME/cmdline-tools/tools/bin:$PATH
By placing it as a subdirectory of ANDROID_HOME
, you can further omit having to provide argument --sdk_root
to sdkmanager
as described here: Android Command line tools sdkmanager always shows: Warning: Could not create settings
Yes, apt-get does not install "tools" directory.
To Download Tools Directory ( which has sdkManager, etc..etc).
There are two ways
From Android Studio --> SDK Manager --> Check "Show Obsolete packages" --> Download platform-tools
- Download Cmd Line tools directory directly from here and place it inside SDK
You need to manually start the Android Studio application installed in your system. [ You can search in the application search bar in ubuntu]Once the installation is completed, you'll see the locations for your SDK manager and your AVD manager.