← 返回
未分类

Xcode Cache Cleaner

Scan and clean build caches for iOS/macOS developers — with first-class Xcode support (global DerivedData, iOS/watchOS/tvOS/macOS DeviceSupport, Caches/com.a...
扫描并清理 iOS/macOS 开发者的构建缓存,提供一流 Xcode 支持(包括全局 DerivedData、iOS/watchOS/tvOS/macOS DeviceSupport、Caches/com.a...)
symbolstar symbolstar 来源
未分类 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 252
下载
💾 0
安装
1
版本
#latest

概述

Xcode Cache Cleaner

Scan a project directory or the global Xcode caches under ~/Library/Developer/, report sizes, and optionally delete to free disk space.

Two Modes

1. Project cache cleanup (per-folder)

bash scripts/clean-cache.sh <target-dir> [--dry-run] [--yes]

Use when the user points at a specific project directory (SPM .build, Pods, node_modules, etc.).

2. Global Xcode cache cleanup (system-wide)

bash scripts/clean-xcode-global.sh [--dry-run] [--yes] \
     [--keep-ios <pattern>]... [--include-archives]

Use when the user asks to clean Xcode / DerivedData / iOS DeviceSupport / simulators globally (e.g. "清一下 Xcode 缓存"、"free space on my mac", "reclaim disk from Xcode").

Covers:

  • ~/Library/Developer/Xcode/DerivedData/* — all deleted
  • ~/Library/Developer/Xcode/{iOS,watchOS,tvOS,macOS} DeviceSupport/* — by default keeps the highest-version folder per platform; pass --keep-ios 26.4.2 --keep-ios 18.5 (repeatable, substring match) to override
  • ~/Library/Caches/com.apple.dt.Xcode — deleted
  • ~/Library/Developer/Xcode/Archives/*listed but NOT deleted by default (these are signed .xcarchive builds). Pass --include-archives to also delete.
  • CoreSimulator unavailable devices — runs xcrun simctl delete unavailable (safe; only removes devices Xcode already lost track of)

Flags:

  • --dry-run — Scan and report only, no deletions
  • --yes / -y — Skip confirmation prompt (use when agent is driving)
  • --keep-ios — Keep DeviceSupport folders matching this substring (repeatable). Applied across all *OS DeviceSupport dirs, not just iOS.
  • --include-archives — Also delete Archives/* (default: keep)

Always run --dry-run first, show the user the results, then ask before running the actual cleanup (or pass --yes if the user already confirmed). Both scripts prefer trash (recoverable) over rm -rf when available.

Supported Cache Types

CachePatternEcosystems
----------------------------
SPM .build.build/ dirsSwift / iOS
DerivedDataDerivedData/ dirsXcode
xcresult*.xcresult bundlesXcode tests
PodsPods/ dirsCocoaPods
Carthage/BuildCarthage/Build/Carthage
node_modulesnode_modules/Node.js
Gradle .gradle.gradle/ dirsAndroid / Java
Gradle buildbuild/ under .gradleAndroid / Java
Rust targettarget/ next to Cargo.tomlRust
Python __pycache____pycache__/ dirsPython
.pytest_cache.pytest_cache/ dirsPython
.mypy_cache.mypy_cache/ dirsPython

The script also reports .git size (not deleted) with a hint to run git gc --aggressive.

Notes

  • All deletions are recoverable by re-building (or via Trash if trash is installed). No source code is touched.
  • The project-mode script resolves the target to an absolute path before scanning.
  • For very large projects, the initial du scan may take a minute.
  • Global-mode default for DeviceSupport (keep highest version) is conservative; if the user has multiple physical devices on different iOS versions, prompt for explicit --keep-ios patterns before deleting.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-21 14:55 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 81 📥 182,962
ai-agent

Agent Token Usage

symbolstar
从轨迹日志中按OpenClaw 代理汇总每日 LLM token 使用量,展示输入、输出、缓存读取/写入、总计以及可选的可计费 token 估算
★ 0 📥 508
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 198 📥 68,187