Skip to content

MacOS Cleaner 3.1.0

Latest

Choose a tag to compare

@AlexTkDev AlexTkDev released this 02 Dec 15:15
· 3 commits to release since this release

Performance, Resource Control, Safety & Stability Release: Introduces unified Scan Performance modes (Economy and Power) with automatic hardware selection and Low Power/thermal step-down, offloads blocking I/O and shell execution to eliminate UI stalls, removes and protects macOS font/icon caches while adding per-user Darwin directory guards, refreshes Dashboard recent operations cards, fixes Liquid Glass scroll clipping on macOS 27.2.1+ and live language switching in Privacy, and improves cancellation logging and unknown-size cleanup handling.


🙏 Acknowledgments

Thanks to everyone who reported Liquid Glass scrolling and localization issues in issue #45, as well as users who shared CPU load and UI responsiveness feedback on Apple Silicon Macs.


⚡ Scan Performance & Engine Overhaul

🎚️ Unified Scan Performance Modes (Economy & Power)

  • Two App-Wide Modes (Economy, Power): Added ScanResourceMode and ScanResourcePolicy under Settings → Cleanup → Scan Performance, shared across Cleanup, Uninstaller, Disk Analyzer, Duplicates, and Dashboard via ScanResourcePolicyCenter and @TaskLocal ScanResourcePolicy.active. Both modes scan the same categories, depth, and safety rules — only CPU priority and parallelism change:
    • Economy: .utility QoS (TaskPriority.utility, DispatchQoS.utility, QualityOfService.utility, userInitiatedAllowingIdleSystemSleep activity), 1–2 parallel categories (min(2, max(1, pCores / 2))). Keeps macOS and other apps responsive during scans.
    • Power: .userInitiated QoS, up to 8 parallel categories (min(8, max(2, pCores))). Automatically steps down to Economy when Low Power Mode is enabled or thermalState >= .serious (.serious or .critical).
  • Automatic Hardware Selection: Detects CPU brand, Apple Silicon status, P-core/E-core performance levels (hw.perflevel0.physicalcpu / hw.perflevel1.physicalcpu), and physical RAM via sysctlbyname. Macs with ≤ 4 P-cores, ≤ 8 GB RAM, VMs without performance levels, or Intel CPUs default to Economy on first launch; higher-core Apple Silicon Macs default to Power.
  • One-Time Economy Banner & Settings UX: Displays a single contextual banner (ResourceModeBannerView) when Economy is auto-selected on first visit to Cleanup, Uninstaller, Disk Analyzer, or Duplicates (not Dashboard, and deferred while Full Disk Access or Update sheets are open), with an Open Settings button that scrolls directly to Settings → Cleanup → Scan Performance. Settings displays a Recommended for your Mac badge, a warning when Power is chosen on Economy-recommended Macs (including an Intel-specific note), and an Important notes block — localized across all 14 languages.
  • Timeout Retries & Unknown-Size Handling: Categories that time out on the main parallel pass are queued and retried once sequentially at 2× timeout. Directory sizing (getDirectorySizeWithTimeout) invalidates the path cache and retries once at 2× timeout before marking the entry as Size unknown (isSizeUnknown, unselected by default) instead of silently dropping it. Explicitly selected size-unknown paths and review targets still clean within the timeout and log removed (size unknown).

🚀 Responsiveness, I/O & Shell Execution

  • No Main-Thread Stalls or QoS Escalation: Root scan workers run via Task.detached with the active policy's priority instead of inheriting .userInitiated from @MainActor. Engine events batch off-main (CleanupEventBatcher, 120 ms batches + synchronous final drain), CleanupItemManager uses O(1) path-set deduplication and incremental totals, Dashboard category updates cap at ~4–5 Hz (220 ms), FileManager.trashItem and permanentlyDelete run off @MainActor via BlockingIO, and AnimatedScanView renders a single adaptive instance at 30 FPS (paused with Reduce Motion). Startup auto-scan waits for the initial Dashboard update.
  • Offloaded Blocking I/O & Single-Pass Cleanup Sizing: Moved blocking filesystem traversals off Swift Concurrency's cooperative pool onto a dedicated concurrent BlockingIO DispatchQueue honoring per-call DispatchQoS with lightweight CancellationFlag checks (PosixScanner bounded by policy concurrency). Removed redundant post-deletion directory walks by summing actually deleted item sizes (invalidating caches before measuring CLI package managers).
  • Single-Probe Shell & Cached PATH: Prewarms UserShellEnvironment on launch and resolves user PATH once per session via a single-flight login-shell probe (3s timeout, marker-delimited parsing, 60s retry on fallback). Standard CLI tools run through /usr/bin/env with cached PATH and policy QoS instead of spawning nested bash/zsh shells. CommandCache caches only found tools so newly installed CLIs are detected. Added -l -c execution and argument escaping (ShellQuoting.fishQuoted, nuQuoted, isSafeNuCommandName) for fish and nushell.

🛡️ Safety Hardening & Cleanup Accuracy

  • Font Cache Category Removed & Protected (41 Categories, 2,422 Paths): Removed the atsutil Font Cache cleanup category and its restart-required prompt to prevent font and icon rendering corruption. SafetyManager.isProtectedFontOrIconPath now blocks macOS font/icon caches (com.apple.fontd, com.apple.fontregistry, com.apple.ats, com.apple.iconservices, com.apple.iconservices.store) and /Library/Fonts / ~/Library/Fonts during both scan and cleanup.
  • Per-User Darwin Directory Guards (DarwinUserDirectories): Resolves per-user …/C, …/T, and …/X directories alongside NSTemporaryDirectory(). FileSystemContext allows current-user …/C and …/X for Uninstaller inspection while SafetyManager protects /var/folders, /private/var/folders, root …/C/…/X directories, all …/C/…/X paths during Cleanup, and com.apple.* entries during Uninstall.
  • Accurate Cancellation Logging: Cancelling a cleanup run preserves completed categories and already-freed bytes (freedBytesTally), records .trash vs .permanent transaction modes accurately when cancelled before emptying Trash, and writes a single category record even when interrupted mid-category.
  • Dynamic Cache & Preview Accuracy: Unselected ~/Library/Caches entries are skipped before sizing and excluded from logs and skipped counts. Non-deletable review items no longer inflate parent group sizes or alter parent risk ratings.

🪟 UI Polish, Liquid Glass & Localization (Issue #45)

  • Liquid Glass Scroll Clipping (macOS 27.2.1+): Scoped GlassEffectContainer strictly to pinned headers and footers in Privacy, Startup Services, Cleanup, Uninstaller, Dashboard, and Disk Analyzer so scrollable controls no longer bleed over headers or the title bar. Added rowButtonStyle() (.bordered / .borderedProminent) for scrolling rows/cards and GlassPillPicker(surface: .content) with horizontal scrolling fallback for narrow windows. Pinned filter pickers above ScrollView in Privacy → Network and Disk Analyzer.
  • Dashboard Recent Operations & Live Rings: Redesigned CleanupCardView with category-colored icons, relative timestamps, proportional freed-space bars, trigger and deletion-mode chips (Trash / Permanent / Mixed), direct click-to-history navigation, a cleanup count badge, and an empty-state hint. Refined DiskRingsChartView progressive scanning arcs and 30 FPS animations with Reduce Motion support.
  • Live Language Switching in Privacy & 14-Language Parity: Replaced cached localized strings in PrivacyViewModel and TCCDatabaseStatus with render-time localization (PrivacyNotice), cleared stale errorMessage on language change so Safari banners and TCC status notices update immediately, removed duplicate uninstaller_show_in_finder keys across .lproj files, and added duplicate-key tests across all 14 languages.

📦 Download & Verification

Asset Description
MacOSCleaner.dmg Release DMG for Apple Silicon (arm64), macOS 26.0+

System Requirements: macOS 26.0+ on Apple Silicon (arm64 only).

# Clear Gatekeeper quarantine flag on first launch (for direct DMG downloads):
xattr -dr com.apple.quarantine /Applications/MacOSCleaner.app

If MacOSCleaner helped you, a ⭐ on the repo helps other people find it: https://github.com/AlexTkDev/MacOSCleaner