If you don’t get any better answers, I’m a big fan of sdkmanager. Here’s a snippet of how I install this part of the toolchain in a Docker image I use for building Ionic apps:
RUN curl -o android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
RUN apt-get update && apt-get install -y \
unzip \
openjdk-8-jdk-headless \
gradle \
libxml2-utils \
lsb-release \
software-properties-common \
apt-transport-https
RUN mkdir /opt/android
RUN unzip -d /opt/android android-sdk.zip
RUN echo "y" | /opt/android/tools/bin/sdkmanager --install "build-tools;28.0.3"
ENV ANDROID_HOME /opt/android
You should be able to more or less run each of these things (it would require root, but by changing the paths to somewhere under your home directory, you could avoid that).