Skip to main content

A beautiful terminal-based utility to clean up Android emulator storage without losing your data

Project description

Android Emulator Cleaner

Android Emulator Cleaner

A beautiful terminal-based utility to clean up Android emulator storage without losing your data

CI Python Versions License Stars

FeaturesInstallationUsageWhat Gets CleanedScreenshotsContributing


🎯 Overview

Android Emulator Cleaner helps Flutter and Android developers free up valuable disk space consumed by Android emulators without wiping user data. Say goodbye to repeatedly signing into Google accounts after cleaning!

The Problem

Android emulators can quickly consume 10-50GB of disk space through:

  • Accumulated app caches
  • Saved snapshots (Quick Boot)
  • Temporary installation files
  • Screenshots and downloads

The Solution

This tool intelligently cleans temporary and cache files while preserving:

  • ✅ Google account sign-in state
  • ✅ Installed applications
  • ✅ App data (except caches)
  • ✅ System settings and preferences

✨ Features

  • 🎨 Beautiful Terminal UI - Rich, colorful interface with progress bars and panels
  • 📱 Multi-Device Support - Clean multiple emulators and physical devices simultaneously
  • 🔧 Selective Cleaning - Choose exactly what to clean with risk indicators
  • 💾 AVD Management - Clean snapshots and cache from stopped emulators
  • 📦 App Uninstallation - Selectively uninstall apps across devices
  • 📊 Storage Monitoring - See before/after storage statistics
  • Zero Data Loss - Preserves accounts, app data, and settings
  • 🐍 Cross-Platform - Works on macOS, Linux, and Windows

📦 Installation

Using pip (Recommended)

pip install android-emulator-cleaner

Using pipx (Isolated Environment)

pipx install android-emulator-cleaner

From Source

# Clone the repository
git clone https://github.com/CanArslanDev/android_emulator_cleaner.git
cd android_emulator_cleaner

# Install in development mode
pip install -e .

Quick Start (No Installation)

# Run directly with Python
pip install rich questionary
python android_emulator_cleaner.py

🚀 Usage

Command Line

# Run the cleaner
android-emulator-cleaner

# Or use the short alias
aec

As Python Module

python -m android_emulator_cleaner

Programmatic Usage

from android_emulator_cleaner import (
    get_connected_devices,
    DeviceCleaner,
    get_cleanup_options,
)

# Get connected devices
devices = get_connected_devices()

# Clean a specific device
for device in devices:
    cleaner = DeviceCleaner(device)
    options = get_cleanup_options()
    results = cleaner.run_all_cleanups(options)

    for result in results:
        print(f"{result.option.name}: {'✓' if result.success else '✗'}")

🧹 What Gets Cleaned

Running Devices (via ADB)

Category Path Risk Description
🗑️ App Caches /data/data/*/cache 🟢 Low Cache files from all installed apps
📁 Temp Files /data/local/tmp/* 🟢 Low APKs and temp files from installations
📥 Downloads /sdcard/Download/* 🟡 Medium Downloaded files
📸 Screenshots /sdcard/Pictures/Screenshots/* 🟡 Medium Captured screenshots
💾 SD Card Caches /sdcard/Android/data/*/cache/* 🟢 Low External storage app caches

AVD Files (Local)

Category Description
📸 Snapshots Quick Boot snapshots (usually the biggest space saver)
🗑️ Cache Files cache.img files from AVDs

🖼️ Screenshots

Main Menu

Cleanup Options

Results

📋 Requirements

  • Python: 3.10 or higher
  • ADB: Android Debug Bridge (part of Android SDK)
  • Android Emulator: For device cleaning
  • Dependencies: rich, questionary (auto-installed)

Verifying ADB Installation

# Check if ADB is installed
adb version

# If not installed, install via:
# macOS (Homebrew)
brew install android-platform-tools

# Ubuntu/Debian
sudo apt install android-tools-adb

# Or download Android SDK Platform Tools
# https://developer.android.com/studio/releases/platform-tools

🏗️ Project Structure

android_emulator_cleaner/
├── src/
│   └── android_emulator_cleaner/
│       ├── __init__.py          # Package initialization
│       ├── __main__.py          # Module entry point
│       ├── cli.py               # CLI logic and user interaction
│       ├── core/
│       │   ├── __init__.py
│       │   ├── adb.py           # ADB command execution
│       │   ├── avd.py           # AVD file management
│       │   └── cleaner.py       # Cleanup operations
│       ├── models/
│       │   ├── __init__.py
│       │   └── types.py         # Data models and types
│       └── ui/
│           ├── __init__.py
│           ├── console.py       # Console output utilities
│           └── panels.py        # Rich panel components
├── tests/                       # Test suite
├── docs/                        # Documentation
├── .github/workflows/           # CI/CD pipelines
├── pyproject.toml              # Project configuration
├── requirements.txt            # Dependencies
└── README.md                   # This file

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Development Setup

# Clone and enter directory
git clone https://github.com/CanArslanDev/android_emulator_cleaner.git
cd android_emulator_cleaner

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

# Run tests
pytest

# Run linting
ruff check .
mypy src/

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=android_emulator_cleaner --cov-report=html

# Run specific test file
pytest tests/test_adb.py -v

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Rich - Beautiful terminal formatting
  • Questionary - Interactive CLI prompts
  • Android SDK Team - ADB and emulator tools

📬 Support


Made with ❤️ for Android Developers

⬆️ Back to Top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

android_emulator_cleaner-1.0.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

android_emulator_cleaner-1.0.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file android_emulator_cleaner-1.0.0.tar.gz.

File metadata

  • Download URL: android_emulator_cleaner-1.0.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for android_emulator_cleaner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3579020e2e8f46beb73508b1e81f7c6b84cbb764f3dfa87bbe7aed0dd05939b2
MD5 7ea1dde6befa67e94ae1a6d538261119
BLAKE2b-256 4a5be705d43cec718e989d95fe16ac9faf247486fd7a2d904140d77e1baad7a0

See more details on using hashes here.

File details

Details for the file android_emulator_cleaner-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for android_emulator_cleaner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d47f654248b610ee061903e2cf3d14ce3bc505d00288b4258ec5dbf6872e229a
MD5 9ee257af81282a81e83dcccce92d24e6
BLAKE2b-256 9adfbafa1979b4ee0c5a50b221f45849cc591f23eeb5e185e0ead6f6b8cde089

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page