- Add simctl availability check before attempting cleanup
- Capture and analyze error output for better diagnostics
- Implement fallback: manual deletion when simctl fails
- Provide specific error hints (permission, in-use, service issues)
- Skip early when no unavailable simulators exist
- Show partial success status when some deletions fail
Error scenarios now handled:
- simctl not available → skip with friendly message
- Permission denied → show hint and try manual deletion
- Device in use → show hint and try manual deletion
- CoreSimulator service issues → show hint
- Partial failures → show "partially cleaned X/Y"
Fixes#520
Replace du traversal + double find with single find -print0 + stat -f%z
to eliminate 8+ minute hang on directories with 392K files. Add progress
feedback via update_progress_if_needed in the outer loop.
The dry-run mode hardcoded SYSTEM_CLEAN=false, which meant
the entire system section was silently skipped during preview.
Users had no way to see what /Library/Caches, /private/var/log,
diagnostics, or other sudo-required paths would be cleaned.
Now dry-run checks for a cached sudo session (sudo -n) and
includes the system preview when available. When sudo isn't
cached, a hint tells the user how to get the full preview
without running the whole script as root.
- reduce noisy scan output outside debug mode
- consolidate final result messaging
- run xcode/code editor stages explicitly in developer flow
- update dev cache tests for new stage calls
- replace direct delete patterns with safe_sudo_find_delete/safe_sudo_remove
- keep log/temp/diagnostic cleanup behavior with guarded scans
- align system maintenance tests with safe deletion flow
- reorganize perform_cleanup sections and naming
- merge macOS + sandbox caches into clean_app_caches
- move recent items and mail downloads into user essentials
- update core/user tests for renamed internal helpers
- Replace ls with find -maxdepth 1 to reduce IO and permission noise
- Keep same behavior: silently skip if directory is empty or inaccessible
Addresses: user.sh (line 484)
- Normalize npm cache paths with pwd -P to handle symlinks and
trailing slashes, preventing duplicate scans of same directory
- Add declare -f check before calling clean_maven_repository for
robustness when dynamic source fails
- Add test for trailing slash handling
Addresses: dev.sh (line 27, 48, 602)
- Save caller's INT/TERM traps before installing local cleanup trap
- Restore original traps after clean_project_artifacts completes
- Add test to verify trap restoration behavior
Fixes P3 issue: project.sh (line 825, 870)
- renderHeader now returns empty string as second return value when
error message is present, avoiding duplicate mole in main.go View
- Add unit tests to prevent regression
Fixes P2 issue: view.go (line 184) + main.go (line 160)
Add clean_group_container_caches() to safely clean Group Containers:
- Skip Apple-owned containers (com.apple.*, group.com.apple.*, systemgroup.com.apple.*)
- For protected apps: only clean Logs directories
- For non-protected apps: clean Logs, tmp, and Caches
- Add symlink checks to prevent path traversal
- Respect whitelist and should_protect_path checks
- Integrate with clean_sandboxed_app_caches flow
Also add symlink checks in process_container_cache() for consistency.
Includes 4 BATS tests covering protected apps, whitelist,
system containers, and empty results handling.