← 返回 Skills 市场
symbolstar

Xcode Cache Cleaner

作者 SymbolStar · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
75
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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 \x3Ctarget-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 \x3Cpattern>]... [--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 \x3Cpattern> — 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

Cache Pattern Ecosystems
SPM .build .build/ dirs Swift / iOS
DerivedData DerivedData/ dirs Xcode
xcresult *.xcresult bundles Xcode tests
Pods Pods/ dirs CocoaPods
Carthage/Build Carthage/Build/ Carthage
node_modules node_modules/ Node.js
Gradle .gradle .gradle/ dirs Android / Java
Gradle build build/ under .gradle Android / Java
Rust target target/ next to Cargo.toml Rust
Python pycache __pycache__/ dirs Python
.pytest_cache .pytest_cache/ dirs Python
.mypy_cache .mypy_cache/ dirs Python

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.
安全使用建议
Only use this after reviewing a dry-run. Do not run it on untrusted or strangely named project folders, avoid --yes until you have approved the exact paths, and be especially careful with DeviceSupport and --include-archives. The publisher should fix the eval usage and make deletion/recoverability behavior match the documentation.
功能分析
Type: OpenClaw Skill Name: xcode-cache-cleaner Version: 0.1.0 The skill is a legitimate utility for cleaning Xcode and project-specific build caches (e.g., DerivedData, Pods, node_modules) to reclaim disk space. The scripts `clean-cache.sh` and `clean-xcode-global.sh` perform targeted deletions of known cache directories, include safety features like dry-run modes and confirmation prompts, and prefer using the system trash when available.
能力评估
Purpose & Capability
The stated purpose and scripts align around cleaning Xcode and project build caches, but the capability is destructive and includes DerivedData, DeviceSupport folders, node_modules, Pods, and optional Archives deletion.
Instruction Scope
SKILL.md tells users to dry-run first and ask before deletion, which is good, but it also overstates recoverability for the project-mode script because that script uses rm -rf rather than Trash.
Install Mechanism
There is no remote installer or package install path, and the referenced helper scripts are included in the artifact set.
Credentials
Project-mode scanning uses eval with a user-derived path, and global DeviceSupport cleanup relies on a non-default macOS sort option that can weaken the documented keep-highest safeguard.
Persistence & Privilege
No credentials, background persistence, or elevated privileges are requested, but the scripts can permanently remove local build/support artifacts unless Trash is used.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install xcode-cache-cleaner
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /xcode-cache-cleaner 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release: per-project cleanup + global Xcode cache cleanup (DerivedData, DeviceSupport with version-keep filter, simulators, Caches/com.apple.dt.Xcode)
元数据
Slug xcode-cache-cleaner
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 75 次。

如何安装 Xcode Cache Cleaner?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install xcode-cache-cleaner」即可一键安装,无需额外配置。

Xcode Cache Cleaner 是免费的吗?

是的,Xcode Cache Cleaner 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Xcode Cache Cleaner 支持哪些平台?

Xcode Cache Cleaner 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Xcode Cache Cleaner?

由 SymbolStar(@symbolstar)开发并维护,当前版本 v0.1.0。

💬 留言讨论