Android Device Manager is a Python library for creating, launching, and managing Android emulators (AVDs) programmatically.
- Create AVDs programmatically from system images
- List existing AVDs and check availability
- Delete AVDs cleanly
- Validate AVD names according to Android rules
- Force recreation of AVDs with
force=True
- Start emulators in headless or windowed mode
- Automatic port allocation for multiple running instances
- Stop emulators gracefully or force-kill when needed
- Custom emulator options via
EmulatorConfiguration
- Execute
adb
commands directly from Python - Install APKs and manage applications (install/uninstall)
- List installed packages and check if a package is installed
- Push and pull files between host and device
- Access
logcat
output and clear logs
- Python: 3.10 or higher
- Android SDK: Latest version recommended
- System Resources: Sufficient RAM and storage for emulators
pip install android-device-manager
git clone https://github.com/jwoirhaye/python-android-avd-manager-python.git
cd python-android-avd-manager
pip install -e .
With everything set up, here’s the simplest way to create and run an emulator:
from android_device_manager import AndroidDevice , AndroidProp
from android_device_manager.avd import AVDConfiguration
from android_device_manager.emulator import EmulatorConfiguration
# Define AVD configuration
avd_config = AVDConfiguration(
name="quickstart_avd",
package="system-images;android-34;google_apis;x86_64"
)
# Define Emulator configuration
emulator_config = EmulatorConfiguration(
no_window=True # Run emulator in headless mode
)
# Create and run the device using context manager
with AndroidDevice(avd_config, emulator_config) as device:
print(f"Device {device.name} is running!")
print("Android Version:", device.get_prop(AndroidProp.ANDROID_VERSION))
# Or
#print("Android Version:", device.get_prop("ro.build.version.release"))
This project is licensed under the MIT License.
- 🐛 Issues: GitHub Issues
- 📬 Contact: [jerem.woirhaye@gmail.com]