asd Android SDK Downloader — offline-friendly SDK component installer

Configuration

asd is configured entirely through environment variables — there is no config file to edit.

Variable Default Description
ANDROID_HOME ~/Android/Sdk Android SDK root directory that components are installed into.
ASD_CSV /opt/myket.csv Path to the local CSV package registry.
ASD_ARIA2C_OPTS -x 16 -s 16 -k 1M Extra options passed straight through to aria2c for every download.

Custom SDK location

export ANDROID_HOME=/path/to/your/android-sdk
export ASD_CSV=/path/to/myket.csv
asd ndk

asd creates $ANDROID_HOME/<package-path> for each component it installs, mirroring the same directory layout sdkmanager uses — so existing tooling (Android Studio, Gradle, sdkmanager itself) will recognize components installed by asd without any extra setup.

Custom registry path

Setting ASD_CSV to a location outside /opt is also how you avoid sudo for registry updates — see Bypassing sudo for the full explanation:

export ASD_CSV=~/.local/share/asd/myket.csv
mkdir -p ~/.local/share/asd
asd -up

Tuning download speed

ASD_ARIA2C_OPTS is passed directly to aria2c, so any aria2c flag is valid here. The default requests 16 connections split across 16 segments with a minimum split size of 1 MiB:

export ASD_ARIA2C_OPTS="-x 16 -s 16 -k 1M"

To throttle bandwidth instead:

export ASD_ARIA2C_OPTS="-x 4 -s 4 --max-download-limit=2M"
asd ndk

Making it permanent

Add whichever variables you use to your shell profile so they persist across sessions:

echo 'export ANDROID_HOME=$HOME/Android/Sdk' >> ~/.bashrc
echo 'export ASD_CSV=$HOME/.local/share/asd/myket.csv' >> ~/.bashrc