- Download Command-Line Tools:
Download the Command Line Tools package for your operating system from the Android Developer website
Windows:
download
Mac:
download
Linux:
download
This package includes the necessary tools like the sdkmanager and the avdmanager files, which are used to manage SDK packages and AVDs, respectively.
- Extract
Android SDK Tools:
- Extract the downloaded zip file to a location on your computer.
- Inside the extracted folder, you will find
sdkmanager and other tools.
- Define the bin address in the OS environment variable.
nano ~/.zshrc
export PATH=$PATH:<path_to_sdk>/cmdline-tools/latest/bin
nano ~/.zshrc
export PATH=$PATH:/Users/doran/Android/cmdline-tools/latest/bin
source ~/.zshrc
- Install SDK Components:
- Open a terminal (or command prompt on Windows), and navigate to the folder where you extracted the command-line tools.
- Install the required SDK packages by the following command:
sdkmanager --update
- Install AVD Manager Tools:
sdkmanager "system-images;android-30;google_apis;x86_64"
- This installs the system image needed to create AVDs. Replace
android-30 with the version you need.
- Create an AVD:
- To create a new AVD run the following command
avdmanager create avd -n <AVD_Name> -k "system-images;android-30;google_apis;x86_64"
- Replace <AVD_Name> with your desired name for the virtual device.
- Launch the AVD:
emulator -avd <AVD_Name>
- Make sure you have a compatible
Java Development Kit (JDK) installed on your system, as it is required for using the SDK tools.