On Ubuntu 18.04, the binary sdkmanager is indeed not included in the apt-package android-sdk.
This worked for me:
- Install
android-sdkviaapt, as you described:
apt-get install android-sdk
- Set environment variable
ANDROID_HOMEif 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#command-tools. 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.zip
unzip commandlinetools-linux-6609375_latest.zip -d cmdline-tools
mkdir --parents "$ANDROID_HOME/cmdline-tools/latest"
sudo mv cmdline-tools/* "$ANDROID_HOME/cmdline-tools/latest/"
export PATH=$ANDROID_HOME/cmdline-tools/latest/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