Android Command-line Tools
Android SDK manager and package tools
Quick Take: Android Command-line Tools
Android SDK Command-line Tools is the definitive solution for developers who want complete control over their Android development environment without the overhead of Android Studio. It excels in CI/CD pipelines, headless build servers, and terminal-centric workflows. While the initial setup requires more configuration than simply installing Android Studio, the payoff is a lean, scriptable, and reproducible environment. The tools integrate smoothly with Homebrew on macOS and work excellently on Apple Silicon. The only significant drawbacks are the lack of visual tools and a steeper learning curve for GUI-accustomed developers.
Best For
- •DevOps engineers managing CI/CD pipelines for Android apps
- •Terminal-centric developers using Neovim, VS Code, or Fleet
- •Teams needing reproducible build environments across machines
- •Developers working on headless servers or cloud environments
What are Android SDK Command-line Tools?
Android SDK Command-line Tools is the official lightweight package from Google that enables Android development without installing the full Android Studio IDE. This collection of essential utilities includes sdkmanager for managing SDK packages, avdmanager for creating and configuring Android Virtual Devices, and apkanalyzer for inspecting APK files. Unlike the legacy 'tools' package, the modern cmdline-tools structure follows a versioned hierarchy that integrates smoothly with CI/CD pipelines and headless build servers. For developers who prefer terminal-centric workflows using editors like Neovim, VS Code, or JetBrains Fleet, these command-line tools provide complete control over the Android development environment without the resource overhead of a full graphical IDE. The package occupies roughly 400MB but unlocks the ability to install any Android platform version, build tools, system images, and emulator components on demand. Whether you are automating nightly builds on a Jenkins server, setting up GitHub Actions for Android testing, or simply prefer a minimalist development setup on your Mac, Android SDK Command-line Tools delivers the foundational utilities required for professional Android development.
Install with Homebrew
brew install --cask android-commandlinetoolsDeep Dive: Mastering Android Development Without Android Studio
Understanding how to use command-line tools for professional Android development on macOS.
History & Background
Android SDK Command-line Tools evolved from the legacy 'tools' directory that shipped with early Android SDKs. As the Android build system matured, Google recognized that developers needed lightweight alternatives to the increasingly resource-heavy Android Studio. The cmdline-tools package was introduced with a versioned directory structure (cmdline-tools/latest/bin) to support multiple tool versions side-by-side and enable cleaner CI/CD integration. This architecture allows updating the tools independently from the IDE.
How It Works
The cmdline-tools package follows a specific directory hierarchy required for proper operation. Inside ANDROID_HOME, you find cmdline-tools/latest/bin containing the executables. sdkmanager downloads packages to their respective directories (platforms/, build-tools/, platform-tools/, system-images/). Each component maintains its own versioning, allowing fine-grained control. The tools communicate with Google's Maven repository to fetch packages and validate licenses against a local license acceptance store.
Ecosystem & Integrations
These tools integrate with the broader Android development ecosystem including Gradle (the primary build system), the Android Gradle Plugin, Firebase CLI for backend services, and various testing frameworks like Espresso. They work with any JetBrains IDE, VS Code with Android extensions, or pure command-line workflows. The emulator package (installed separately via sdkmanager) provides hardware-accelerated virtual devices that perform excellently on Apple Silicon through native ARM64 system images.
Future Development
Google continues to update cmdline-tools alongside Android Studio releases. Recent versions added improved support for Android 15 (API 35), better ARM64 compatibility for Apple Silicon, and enhanced package dependency resolution. The sdkmanager now supports offline mode for air-gapped environments and improved caching. Future versions are expected to bring better integration with Gradle build caching and potentially a unified command for common workflows.
Key Features
sdkmanager
The official package manager for the Android SDK. It allows you to list available packages, install specific platform versions (like android-35), update build-tools, download system images for emulators, and manage the entire SDK ecosystem from the command line. Run 'sdkmanager --list' to see all available packages or 'sdkmanager --install platform-tools' to add ADB support.
avdmanager
Create and manage Android Virtual Devices without Android Studio's graphical interface. Perfect for CI/CD environments where you need to spin up emulators programmatically. You can specify device profiles, system images, and hardware configurations entirely through command-line arguments, making automated testing pipelines reproducible and scriptable.
apkanalyzer
A powerful diagnostic tool that provides detailed insights into APK file composition. Inspect the manifest, analyze the DEX file structure, measure the size contribution of resources and code, and compare different APK versions. Essential for optimizing app size and understanding what gets bundled into your final release.
Headless Operation
Unlike Android Studio which requires a display server, the command-line tools work perfectly in SSH sessions, Docker containers, and headless CI runners. This makes them ideal for cloud-based build systems on macOS build agents where GUI resources are unavailable or undesirable.
License Management
Accept SDK licenses non-interactively using 'sdkmanager --licenses' with automated yes responses, enabling fully automated environment setup in CI pipelines without manual intervention.
Who Should Use Android Command-line Tools?
1The CI/CD Engineer
A DevOps engineer maintains GitHub Actions workflows for a mobile development team. By using Android SDK Command-line Tools in their macOS runners, they install only the specific platform versions and build-tools needed for each project. The workflows run 'sdkmanager' to fetch dependencies, create AVDs with 'avdmanager' for instrumented tests, and execute Gradle builds without ever installing Android Studio. This reduces runner setup time by 70% and ensures reproducible builds across all team members.
2The Terminal-First Developer
A senior Android developer uses Neovim with LSP support for all their coding. They install cmdline-tools via Homebrew, configure ANDROID_HOME in their shell profile, and use sdkmanager to maintain multiple platform versions for different client projects. They run Gradle builds directly from the terminal, use ADB for device debugging, and never need to launch a heavy IDE. Their workflow is fast, scriptable, and works identically across their M3 MacBook and cloud development environments.
3The App Size Optimizer
A mobile performance engineer is tasked with reducing an app's APK size before a major release. Using apkanalyzer, they generate detailed reports showing which resources, libraries, and DEX files contribute most to the bundle size. They compare the current release against the previous version to identify size regressions, then systematically remove unused resources and enable code shrinking. The entire analysis happens in the terminal with scriptable commands that integrate into their automated build reports.
Install Android SDK Command-line Tools on Mac
The recommended installation method for macOS users is through Homebrew, which handles path configuration and updates automatically. You will also need JDK 17 installed as a prerequisite since sdkmanager requires a compatible Java runtime.
Install Homebrew
If you do not have Homebrew installed, open Terminal and run: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`.
Install JDK 17
The command-line tools require JDK 17. Install it via Homebrew: `brew install openjdk@17`. Then symlink it: `sudo ln -sfn $(brew --prefix)/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk`.
Install Android Command-line Tools
Run the Homebrew cask command: `brew install --cask android-commandlinetools`. This installs the tools to /opt/homebrew/share/android-commandlinetools on Apple Silicon Macs.
Configure Environment Variables
Add these lines to your ~/.zshrc or ~/.bash_profile: `export ANDROID_HOME="/opt/homebrew/share/android-commandlinetools"` and `export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools"`.
Accept Licenses
Run `sdkmanager --licenses` and accept all licenses to enable package installation. For CI automation, use `yes | sdkmanager --licenses`.
Install Essential Packages
Install platform-tools for ADB: `sdkmanager "platform-tools"`. Install a platform version: `sdkmanager "platforms;android-35"`. Install build-tools: `sdkmanager "build-tools;35.0.0"`.
Pro Tips
- • Run 'sdkmanager --list' to see all available packages and their versions.
- • Use 'sdkmanager --update' regularly to keep all installed packages current.
- • Create a script that installs your project's required SDK components for team consistency.
Configuration Tips
Set Up Multiple Platform Versions
Install multiple Android platforms side-by-side for testing compatibility: `sdkmanager "platforms;android-34" "platforms;android-35"`. Reference them in your Gradle files using compileSdk and targetSdk properties.
Configure Emulator System Images
For ARM-based Macs (M1/M2/M3/M4), install ARM64 system images: `sdkmanager "system-images;android-35;google_apis;arm64-v8a"`. Then create an AVD: `avdmanager create avd -n Pixel_8_API_35 -k "system-images;android-35;google_apis;arm64-v8a" -d pixel_8`.
Optimize for CI/CD
In CI environments, cache the ANDROID_HOME directory between builds to avoid re-downloading packages. Use specific version locks in your sdkmanager commands rather than 'latest' to ensure reproducible builds.
Integrate with Gradle
Set `sdk.dir` in your local.properties file to point to ANDROID_HOME, or let Gradle auto-detect it from the environment variable. Use `./gradlew assembleRelease` for command-line builds without needing Android Studio.
Alternatives to Android Command-line Tools
While Android SDK Command-line Tools is the official solution from Google, developers have other options depending on their specific needs for Android development tooling.
Android Studio
Android Platform Tools
ASDF/Mise Version Manager
Pricing
Android SDK Command-line Tools is completely free and open-source, distributed under the Apache 2.0 license. There are no subscription fees, premium tiers, or usage limits. Google provides these tools at no cost to encourage Android development across all platforms. The only consideration is storage space for downloaded SDK components, which can range from a few hundred megabytes for minimal setups to 20GB+ for comprehensive development environments with multiple platform versions and system images.
Pros
- ✓Extremely lightweight compared to full Android Studio installation (400MB vs 2GB+).
- ✓Perfect for CI/CD pipelines and headless build servers without GUI requirements.
- ✓Complete control over which SDK components are installed, reducing disk usage.
- ✓Scriptable and automatable for reproducible development environments.
- ✓Works smoothly on Apple Silicon Macs with ARM64 system images.
- ✓Free and officially supported by Google with regular updates.
- ✓Integrates naturally with terminal-centric workflows and editors like Neovim.
Cons
- ✗Requires manual environment variable configuration (ANDROID_HOME, PATH).
- ✗No visual layout editor or device mirroring capabilities.
- ✗Initial learning curve for developers coming from GUI-based Android Studio.
- ✗Emulator management is less intuitive without the AVD Manager GUI.
- ✗Troubleshooting SDK issues may require more command-line expertise.
- ✗Some advanced Android Studio features (Profiler, App Inspector) are unavailable.
Community & Support
Android SDK Command-line Tools is supported through Google's official Android developer documentation, which provides comprehensive guides for all included utilities including sdkmanager, avdmanager, and apkanalyzer. The Android Developers subreddit, Stack Overflow's android tag (with over 1.5 million questions), and the official Android issue tracker are primary resources for community support. Since these tools are part of the broader Android ecosystem, solutions to common problems are widely documented across blogs, YouTube tutorials, and developer conference talks. Homebrew maintainers also keep the cask formula updated with new releases, typically within days of Google publishing new versions. For enterprise support, Google offers paid support through Android Enterprise programs, though most developers find community resources sufficient for their needs. GitHub repositories like android-sdk-installer and various Docker images provide pre-configured environments that simplify onboarding for new team members. The command-line tools community is particularly active in CI/CD-focused forums, where DevOps engineers share optimized pipeline configurations, caching strategies, and troubleshooting guides for headless Android builds.
Frequently Asked Questions about Android Command-line Tools
Our Verdict
Android SDK Command-line Tools is the definitive solution for developers who want complete control over their Android development environment without the overhead of Android Studio. It excels in CI/CD pipelines, headless build servers, and terminal-centric workflows. While the initial setup requires more configuration than simply installing Android Studio, the payoff is a lean, scriptable, and reproducible environment. The tools integrate smoothly with Homebrew on macOS and work excellently on Apple Silicon. The only significant drawbacks are the lack of visual tools and a steeper learning curve for GUI-accustomed developers.
About the Author
Expert Tips for Android Command-line Tools
Always pin specific versions of build-tools in CI scripts rather than installing 'latest' to ensure reproducible builds across different environments and time periods.
On Apple Silicon Macs, use arm64-v8a system images for significantly better emulator performance compared to x86_64 images running through Rosetta translation.
Use apkanalyzer to compare APK sizes between releases by running 'apkanalyzer apk compare old.apk new.apk'. This highlights exactly which files grew or shrank, making it trivial to catch accidental inclusion of debug assets or unoptimized resources before shipping to production.
When running emulators on Apple Silicon Macs, use the -no-snapshot flag during initial setup to avoid snapshot corruption issues, then enable snapshots once the AVD is configured correctly. This prevents the frustrating 'emulator keeps crashing on boot' problem that many developers encounter with fresh AVD configurations.
Related Technologies & Concepts
Related Topics
Android Development Tools
Software packages essential for building, testing, and deploying Android applications on macOS.
CI/CD Build Tools
Command-line utilities designed for automated build pipelines and continuous integration systems.
Terminal Development Environment
Tools for developers who prefer command-line workflows over graphical IDEs.
Sources & References
Fact-CheckedLast verified: Jan 24, 2026
Key Verified Facts
- Android SDK Command-line Tools requires JDK 17 for sdkmanager to function correctly.[android-docs-cmdline]
- The cmdline-tools package replaced the legacy 'tools' package with a versioned directory structure.[android-docs-cmdline]
- Homebrew installs cmdline-tools to /opt/homebrew/share/android-commandlinetools on Apple Silicon Macs.[homebrew-cask]
- 1Android Studio Command Line Tools Documentation
Accessed Jan 24, 2026
- 2Homebrew Cask: android-commandlinetools
Accessed Jan 24, 2026
- 3sdkmanager Documentation
Accessed Jan 24, 2026
Research queries: Android SDK command-line tools Mac 2026 sdkmanager avdmanager Homebrew