How to Run Android Emulator for Development Without Android Studio

How to Run Android Emulator for Development Without Android Studio cloudi africa
2 mn read

Introduction

Android Studio is the go-to tool for Android development, but sometimes you might need to run an Android Emulator without the full IDE. This tutorial will guide you through setting up and running an Android Virtual Device (AVD) Emulator without installing Android Studio.

Step 1: Get the Command Line Tools

  • Scroll down to the “Command line tools only” section.
Command line tools only
  • Download the appropriate zip file for your operating system.
  • Extract the zip file to a location of your choice. You’ll get a folder named cmdline-tools.

Step 2: Download Essential Packages

We’ll use the sdkmanager tool to download necessary packages:

  1. Open a terminal and navigate to the cmdline-tools/bin directory.
  2. Run the following command to check if everything is set up correctly:

If you encounter a Java version error, install the latest Java on your system.

  1. If you get an error about determining the SDK root, move all files inside cmdline-tools/ to cmdline-tools/latest/.
  2. Install platform-tools and emulator packages:
./sdkmanager platform-tools emulator

Step 3: Set Environment Variables

Set the following environment variables:

ANDROID_SDK_ROOT=Path to your SDK folder
ANDROID_HOME=Same as ANDROID_SDK_ROOT

Add these directories to your PATH:

  • Path to the emulator directory
  • Path to the platform-tools directory
  • Path to cmdline-tools/latest/bin

Step 4: Download Platform-Specific Packages

Install necessary platform packages. For example, for API Level 32:

sdkmanager "platforms;android-32"
sdkmanager "build-tools;32.0.0"
sdkmanager "system-images;android-32;google_apis;x86_64"

Step 5: Create an AVD Device

Use the avdmanager command to create an AVD:

avdmanager create avd --name android32 --package "system-images;android-32;google_apis;x86_64"

Step 6: Run the Android Emulator

Launch your emulator using one of these commands:

emulator -avd android32

or

emulator @android32

And we can see our AVD emulator running, yay!

android emulator

Conclusion

You now have a functioning Android Emulator without the need for Android Studio. This setup is perfect for developers who prefer lightweight environments or need to run Android apps in specific scenarios.

Additional Tips:

  • You can modify AVD configurations in the config.ini file located in the AVD directory.
  • Keep your SDK packages updated regularly using the sdkmanager tool.
  • If you encounter any issues, ensure that all environment variables are set correctly.

Remember to test this process thoroughly on your system and adjust any steps as necessary for your specific setup.

Leave a Reply

Your email address will not be published. Required fields are marked *

Reading is essential for those who seek to rise above the ordinary.

ABOUT US

The internet as we know is powerful. Its underlying technologies are transformative, but also, there’s a plethora of haphazard information out there.We are here to serve you as a reliable and credible source to gain consistent information

© 2024, cloudiafrica
Cloudi Africa