82

I installed via apt-get install android-sdk.

However, doing a find / -name sdkmanager reveals there is no such binary anywhere on the system.

On my Mac, the binary exists in $ANDROID_HOME/tools/bin.

However, on the Ubuntu system (the system with the issue), the binary does not exist there:

$ ls $ANDROID_HOME/tools/bin
e2fsck
fsck.ext4
mkfs.ext4
resize2fs
screenshot2
tune2fs

Where is the sdkmanager?

Edit:

Not sure why the above didn't install sdkmanager, however, one solution I found was to install manually (instead of via apt-get) by downloading the Linux files at https://developer.android.com/studio/#downloads under the "Command line tools only" header.

1
  • Can you please share some information on where did you extract the content of the commandlinetools package in relation to your solution? did you use the same directory where the android-sdk was created (i.e.: /usr/lib/android-sdk/)? Commented Jun 16, 2020 at 7:39

4 Answers 4

77

On Ubuntu 18.04, the binary sdkmanager is indeed not included in the apt-package android-sdk.

This worked for me:

  1. Install android-sdk via apt, as you described:
apt-get install android-sdk
  1. Set environment variable ANDROID_HOME if not done yet. For example:
export ANDROID_HOME=/usr/lib/android-sdk
  1. 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

Sign up to request clarification or add additional context in comments.

5 Comments

You need sudo to create the directory
export PATH=$ANDROID_HOME/cmdline-tools/latest/tools/bin:$PATH seems to be correct, the /tools/ segment was missing in your commands
I also needed to adapt the path in the last command.
Ubuntu 22.04 using apt install sdkmanager.. export ANDROID_HOME=/usr/lib/android-sdk wasnt needed.
I think this is better than installing the sdkmanager with apt because it places all the tools inside the folder /usr/lib/android-sdk without specifying and additional parameters. It is important only that the owner of the folder /usr/lib/android-sdk is the current user to prevent any installation and license acceptance problems.
19

Since Ubuntu 22 (Jammy), you can simply install it via :

apt install sdkmanager

3 Comments

in my cases, it still says Android sdkmanager not found , when running flutter doctor --android-licenses ...any idea? thanks
This works on debian too
Yep ... twerks on Debian GNU/Linux 12 (bookworm)
8

Yes, apt-get does not install "tools" directory.

To Download Tools Directory ( which has sdkManager, etc..etc).

There are two ways

  1. From Android Studio --> SDK Manager --> Check "Show Obsolete packages" --> Download platform-tools

  2. Download Cmd Line tools directory directly from here and place it inside SDK

1 Comment

If you're using macOS x you can download it with homebrew brew install --cask android-sdk
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.