Flutter is an amazing cross-platform framework, but it comes with a significant disk space cost. Between the Flutter SDK itself, Dart pub cache, platform build artifacts, and iOS simulator data, a typical Flutter developer's Mac can have 10-30GB or more consumed by Flutter-related files alone.
In this guide, we'll identify every Flutter and Dart cache directory on macOS, measure their sizes, and show you how to clean them safely -- without breaking your development environment.
Where Does Flutter Store Data on macOS?
Flutter and Dart scatter data across multiple locations. Here's the complete map:
| Directory | What It Stores | Typical Size |
|---|---|---|
| ~/development/flutter/ | Flutter SDK + engine artifacts | 2-8 GB |
| ~/.pub-cache/ | Downloaded Dart/Flutter packages | 1-5 GB |
| ~/.dartServer/ | Dart analysis server cache | 100-500 MB |
| ~/.dart/ | Dart tool cache & analytics | 50-200 MB |
| ~/.dart-tool/ | Dart tool configuration | 10-50 MB |
| build/ (per project) | Compiled platform artifacts | 500 MB - 3 GB each |
| .dart_tool/ (per project) | Package config & build cache | 50-200 MB each |
| ios/Pods/ (per project) | iOS CocoaPods dependencies | 200 MB - 2 GB each |
| ~/Library/Developer/CoreSimulator/ | iOS simulators (shared with Xcode) | 5-30 GB |
| ~/.android/ | Android SDK/AVD data | 5-20 GB |
Step 1: Audit Your Flutter Disk Usage
Before cleaning anything, let's measure the damage:
# Flutter SDK size
du -sh $(which flutter | sed 's|/bin/flutter||')
# Pub cache size
du -sh ~/.pub-cache/
# Dart caches
du -sh ~/.dartServer/ ~/.dart/ ~/.dart-tool/ 2>/dev/null
# Find ALL build/ directories in Flutter projects
find ~/Projects -name "build" -path "*/android/*" -prune -o \
-name "build" -type d -print 2>/dev/null | \
while read d; do du -sh "$d" 2>/dev/null; done | sort -rh | head -20
# Find all .dart_tool directories
find ~/Projects -name ".dart_tool" -type d -exec du -sh {} + 2>/dev/null | sort -rh
# iOS Pods in Flutter projects
find ~/Projects -name "Pods" -path "*/ios/*" -exec du -sh {} + 2>/dev/null | sort -rh
# iOS simulators (shared with Xcode)
du -sh ~/Library/Developer/CoreSimulator/Devices/ 2>/dev/null
# Android AVDs
du -sh ~/.android/avd/ 2>/dev/null
Step 2: Clean Flutter Project Build Artifacts
The safest and most impactful cleanup starts with project-level build artifacts:
Clean a Single Project
# Inside your Flutter project directory:
flutter clean
# This removes:
# - build/ directory (compiled artifacts)
# - .dart_tool/ (package resolution cache)
# - ios/Pods/ (CocoaPods dependencies)
# - ios/.symlinks/
Clean ALL Flutter Projects at Once
# Find and clean all Flutter projects
find ~ -name "pubspec.yaml" -maxdepth 5 -type f 2>/dev/null | while read f; do
dir=$(dirname "$f")
if [ -d "$dir/build" ] || [ -d "$dir/.dart_tool" ]; then
echo "Cleaning: $dir"
(cd "$dir" && flutter clean 2>/dev/null)
fi
done
# Or just remove build directories directly (faster)
find ~/Projects -name "build" -type d -not -path "*/.*" | while read d; do
size=$(du -sh "$d" 2>/dev/null | cut -f1)
echo "Removing $d ($size)"
rm -rf "$d"
done
Step 3: Clean the Dart Pub Cache
The ~/.pub-cache/ directory stores every version of every package you've ever used. Over time, it accumulates old versions that are no longer needed.
# Check pub cache size
du -sh ~/.pub-cache/
# See what's inside
du -sh ~/.pub-cache/hosted/
du -sh ~/.pub-cache/git/
du -sh ~/.pub-cache/bin/
# List cached packages
ls ~/.pub-cache/hosted/pub.dev/ | wc -l
# Clean and repair pub cache (removes and re-downloads)
flutter pub cache repair
# Nuclear option: wipe entire pub cache
flutter pub cache clean
# Or: rm -rf ~/.pub-cache/hosted/
Step 4: Clean Flutter SDK Artifacts
The Flutter SDK itself can grow over time as it downloads engine artifacts for different platforms and versions:
# Check SDK internal cache
du -sh $(flutter --version 2>/dev/null | head -1 | awk '{print $NF}')/bin/cache/ 2>/dev/null
# Or find it manually
du -sh ~/development/flutter/bin/cache/
# Breakdown of SDK cache
du -sh ~/development/flutter/bin/cache/artifacts/
du -sh ~/development/flutter/bin/cache/dart-sdk/
du -sh ~/development/flutter/bin/cache/downloads/
# Clean SDK cache (will re-download on next use)
flutter precache --all-platforms
# Or selectively:
flutter precache --ios --macos # only platforms you need
# Remove artifacts for platforms you don't target
# (saves 1-3GB per platform)
rm -rf ~/development/flutter/bin/cache/artifacts/engine/android*
rm -rf ~/development/flutter/bin/cache/artifacts/engine/linux*
rm -rf ~/development/flutter/bin/cache/artifacts/engine/windows*
Step 5: Clean Dart Analysis Server Cache
# The Dart analysis server accumulates cache data
du -sh ~/.dartServer/ 2>/dev/null
# Safe to delete -- regenerated automatically
rm -rf ~/.dartServer/
# Also check for Dart tool caches
du -sh ~/.dart/ 2>/dev/null
rm -rf ~/.dart/
Step 6: Clean iOS Simulator Data (Flutter iOS Development)
If you develop Flutter apps for iOS, simulator data is often the single largest cache item:
# Check simulator sizes
xcrun simctl list devices | grep -c "Booted\|Shutdown"
du -sh ~/Library/Developer/CoreSimulator/Devices/
# Delete unavailable/broken simulators
xcrun simctl delete unavailable
# List all simulators with sizes
xcrun simctl list devices -j | python3 -c "
import json, sys, os, subprocess
data = json.load(sys.stdin)
for runtime, devices in data.get('devices', {}).items():
for d in devices:
path = os.path.expanduser(f'~/Library/Developer/CoreSimulator/Devices/{d[\"udid\"]}')
if os.path.exists(path):
size = subprocess.getoutput(f'du -sh \"{path}\" 2>/dev/null').split('\t')[0]
print(f'{size}\t{d[\"name\"]} ({d[\"state\"]})')
" 2>/dev/null | sort -rh | head -15
# Delete specific old simulators
xcrun simctl delete <UDID>
# Erase all simulator content (keeps simulators, removes app data)
xcrun simctl erase all
Step 7: Clean Android Build Caches (Flutter Android Development)
# Gradle caches from Android builds
du -sh ~/.gradle/caches/
du -sh ~/.gradle/wrapper/
# Android SDK caches
du -sh ~/.android/ 2>/dev/null
du -sh ~/Library/Android/sdk/ 2>/dev/null
# Clean Gradle build cache
cd your_flutter_project/android
./gradlew cleanBuildCache 2>/dev/null
./gradlew clean
# Clean Gradle caches older than 30 days
find ~/.gradle/caches/ -maxdepth 1 -type d -mtime +30 -exec rm -rf {} +
# Remove old Gradle wrapper versions
ls ~/.gradle/wrapper/dists/
# Keep only the latest version, remove others
Step 8: Clean CocoaPods Cache (Flutter iOS Dependencies)
Flutter iOS projects use CocoaPods, which maintains its own cache:
# Check CocoaPods cache
du -sh ~/Library/Caches/CocoaPods/
# Clean CocoaPods cache
pod cache clean --all
# Remove Pods directories from all Flutter projects
find ~/Projects -path "*/ios/Pods" -type d -exec rm -rf {} + 2>/dev/null
# After cleaning, regenerate in your project:
cd your_project/ios && pod install
The Complete Flutter Cleanup Script
Here's a comprehensive script that audits and optionally cleans everything:
#!/bin/bash
echo "=== Flutter & Dart Disk Usage Audit ==="
echo ""
# SDK
SDK_PATH=$(dirname $(dirname $(which flutter 2>/dev/null)) 2>/dev/null)
if [ -n "$SDK_PATH" ] && [ -d "$SDK_PATH" ]; then
echo "Flutter SDK: $(du -sh "$SDK_PATH" 2>/dev/null | cut -f1)"
echo " SDK cache: $(du -sh "$SDK_PATH/bin/cache" 2>/dev/null | cut -f1)"
fi
# Pub cache
echo "Pub cache: $(du -sh ~/.pub-cache 2>/dev/null | cut -f1)"
# Dart caches
echo "Dart server: $(du -sh ~/.dartServer 2>/dev/null | cut -f1)"
echo "Dart config: $(du -sh ~/.dart 2>/dev/null | cut -f1)"
# Project build artifacts
TOTAL_BUILD=0
count=0
find ~/Projects -name "pubspec.yaml" -maxdepth 5 -type f 2>/dev/null | while read f; do
dir=$(dirname "$f")
if [ -d "$dir/build" ]; then
size=$(du -sk "$dir/build" 2>/dev/null | cut -f1)
count=$((count + 1))
echo " Build: $dir/build ($(du -sh "$dir/build" 2>/dev/null | cut -f1))"
fi
done
# iOS Simulators
echo "iOS Simulators: $(du -sh ~/Library/Developer/CoreSimulator 2>/dev/null | cut -f1)"
# Android
echo "Android SDK: $(du -sh ~/Library/Android/sdk 2>/dev/null | cut -f1)"
echo "Android AVDs: $(du -sh ~/.android/avd 2>/dev/null | cut -f1)"
# Gradle (from Android builds)
echo "Gradle cache: $(du -sh ~/.gradle/caches 2>/dev/null | cut -f1)"
# CocoaPods
echo "CocoaPods cache: $(du -sh ~/Library/Caches/CocoaPods 2>/dev/null | cut -f1)"
echo ""
echo "=== Recommendations ==="
echo "1. Run 'flutter clean' in inactive projects"
echo "2. Run 'flutter pub cache clean' to clear package cache"
echo "3. Delete unused iOS simulators: xcrun simctl delete unavailable"
echo "4. Clean Gradle: find ~/.gradle/caches -mtime +30 -delete"
echo "5. Use ClearDisk for a visual overview: https://github.com/bysiber/cleardisk"
Skip the Manual Work -- Use ClearDisk
ClearDisk is a free, open-source macOS menu bar app that automatically finds and measures all your Flutter, Dart, pub cache, build artifacts, iOS simulators, and Android caches in one clean dashboard.
Download ClearDisk Free on GitHubHow Much Space Can You Recover?
| Action | Space Recovered | Risk Level |
|---|---|---|
| flutter clean on all projects | 2-15 GB | None -- safe |
| Clean pub cache | 1-5 GB | Low -- re-downloads on demand |
| Delete unused simulators | 2-10 GB | Low -- re-download available |
| Clean Gradle cache | 1-5 GB | Low -- re-downloads on build |
| Remove unused SDK platform artifacts | 1-3 GB | Medium -- re-download needed |
| Clean CocoaPods cache | 500 MB - 2 GB | Low -- pod install restores |
| Delete Dart analysis cache | 100-500 MB | None -- auto-regenerated |
Preventing Cache Bloat
Keep your Flutter disk usage under control going forward:
- Run flutter clean before committing -- build artifacts don't belong in git and don't need to persist
- Only precache platforms you use -- flutter precache --ios --macos instead of --all-platforms
- Delete old simulators regularly -- you probably don't need iOS 15 and 16 simulators anymore
- Use FVM (Flutter Version Management) -- manages SDK versions efficiently instead of multiple full installs
- Schedule monthly cleanups -- or use ClearDisk to monitor and stay on top of cache growth
Flutter Cache vs Other Developer Tools
How does Flutter compare to other tools for disk usage?
| Developer Tool | Typical Cache Size on macOS |
|---|---|
| Flutter + Dart (everything) | 10-30 GB |
| Xcode + DerivedData + Simulators | 15-50 GB |
| Docker Desktop | 10-30 GB |
| node_modules (across projects) | 5-20 GB |
| Homebrew | 2-8 GB |
| Rust (cargo + target/) | 5-25 GB |
| Go modules | 1-5 GB |
| Python (pip + virtualenvs) | 2-10 GB |
Flutter sits in the upper tier of disk-hungry tools, primarily because of the iOS simulator and Android SDK requirements. If you're doing full cross-platform development (iOS, Android, macOS, web), the combined footprint is substantial.
Quick Reference: Essential Cleanup Commands
# Quick wins (safe, high impact)
flutter clean # Clean current project
flutter pub cache clean # Clear package cache
xcrun simctl delete unavailable # Remove broken simulators
# Medium impact
rm -rf ~/.dartServer/ # Dart analysis cache
pod cache clean --all # CocoaPods cache
# Deep clean
find ~/Projects -name "build" -path "*/flutter*" -exec rm -rf {} +
find ~/.gradle/caches -mtime +30 -delete
# Audit
flutter doctor -v # Check Flutter health
du -sh ~/.pub-cache ~/Library/Developer/CoreSimulator ~/.gradle/caches
Automate Your Flutter Cache Monitoring
Stop manually running du commands. ClearDisk sits in your menu bar and shows you Flutter caches, pub packages, simulators, and every other developer cache -- all in one click.
Get ClearDisk -- Free & Open Source