{"id":50454693,"url":"https://github.com/iliyami/MacClean","last_synced_at":"2026-06-03T06:00:46.619Z","repository":{"id":360601890,"uuid":"1250894540","full_name":"iliyami/MacClean","owner":"iliyami","description":"The open-source Mac cleaner, optimizer, and malware scanner. A free alternative to CleanMyMac — built with Swift 6 and SwiftUI.","archived":false,"fork":false,"pushed_at":"2026-05-30T23:00:15.000Z","size":6524,"stargazers_count":56,"open_issues_count":12,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-31T00:20:23.368Z","etag":null,"topics":["appkit","cleanmymac","cleanmymac-alternative","darwin","disk-cleaner","duplicate-finder","homebrew-cask","mac-cleaner","mac-utility","macos","macos-app","malware-scanner","no-subscription","open-source","privacy","swift","swift6","swiftui","system-cleaner","uninstaller"],"latest_commit_sha":null,"homepage":"https://github.com/iliyami/MacClean","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iliyami.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":null},"created_at":"2026-05-27T04:07:33.000Z","updated_at":"2026-05-30T23:22:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/iliyami/MacClean","commit_stats":null,"previous_names":["iliyami/macclean"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/iliyami/MacClean","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliyami%2FMacClean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliyami%2FMacClean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliyami%2FMacClean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliyami%2FMacClean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iliyami","download_url":"https://codeload.github.com/iliyami/MacClean/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iliyami%2FMacClean/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33850627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appkit","cleanmymac","cleanmymac-alternative","darwin","disk-cleaner","duplicate-finder","homebrew-cask","mac-cleaner","mac-utility","macos","macos-app","malware-scanner","no-subscription","open-source","privacy","swift","swift6","swiftui","system-cleaner","uninstaller"],"created_at":"2026-06-01T02:00:21.373Z","updated_at":"2026-06-03T06:00:46.612Z","avatar_url":"https://github.com/iliyami.png","language":"Swift","funding_links":[],"categories":["ユーティリティ","Cleanup \u0026 Uninstall"],"sub_categories":["クリーンアップとアンインストール","Text"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/app_icon.png\" width=\"150\" alt=\"Mac Clean Icon\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eMac Clean\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eThe open-source Mac cleaner, optimizer, and malware scanner.\u003c/strong\u003e\u003cbr\u003e\n  A feature-complete, free alternative to CleanMyMac — built with Swift 6 and SwiftUI.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/platform-macOS%2014%2B-blue?style=flat-square\" alt=\"macOS 14+\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/swift-6.0-orange?style=flat-square\" alt=\"Swift 6\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/tests-403%20passing-brightgreen?style=flat-square\" alt=\"Tests\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-BSD--3--Clause-green?style=flat-square\" alt=\"License\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/security-audited-purple?style=flat-square\" alt=\"Security\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-ff69b4?style=flat-square\" alt=\"PRs Welcome\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/demo.png\" width=\"700\" alt=\"Mac Clean Screenshot\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eInstall in one command:\u003c/strong\u003e\n\u003c/p\u003e\n\n```bash\nbrew tap iliyami/macclean \u0026\u0026 brew install --cask mac-clean\n```\n\n\u003cp align=\"center\"\u003e\n  Or grab the \u003ca href=\"https://github.com/iliyami/MacClean/releases/latest\"\u003elatest DMG\u003c/a\u003e from Releases.\n\u003c/p\u003e\n\n---\n\n## What is Mac Clean?\n\nMac Clean is a **free, open-source** macOS app that cleans junk files, removes malware, optimizes performance, uninstalls apps completely, and visualizes disk usage — all from a single, beautiful interface. It replicates every major feature of CleanMyMac while being fully transparent and community-driven.\n\n**No subscriptions. No telemetry. No ads. Just a clean Mac.**\n\n## How Mac Clean compares\n\n|  | Mac Clean | CleanMyMac | Pearcleaner | PureMac | OnyX | Mole |\n|---|:---:|:---:|:---:|:---:|:---:|:---:|\n| **Price** | Free | $39.95/yr | Free | Free | Free | Free (CLI) |\n| **Open source** | ✅ BSD-3 | ❌ | ✅ Fair-code | ✅ MIT | ❌ | ✅ MIT |\n| **Telemetry** | ❌ None | ⚠️ Yes | ❌ None | ❌ None | ❌ None | ❌ None |\n| **Native GUI app** | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ CLI (paid GUI separate) |\n| **Smart Scan (one-click)** | ✅ | ✅ | ❌ | ➖ Partial | ❌ | ➖ Interactive CLI |\n| **System Junk (16 categories)** | ✅ | ✅ | ➖ | ✅ | ➖ Limited | ✅ |\n| **Universal Binary thinning** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |\n| **Malware scanner** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |\n| **Browser privacy cleaner** | ✅ | ✅ | ❌ | ❌ | ➖ | ❌ |\n| **Uninstaller with leftover detection** | ✅ 10-level | ✅ | ✅ Focus | ❌ | ❌ | ✅ |\n| **Disk treemap visualizer** | ✅ | ❌ | ❌ | ❌ | ❌ | ➖ Analyzer |\n| **Duplicate finder** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |\n| **Menu bar system monitor** | ✅ | ✅ Menu | ❌ | ❌ | ❌ | ❌ |\n| **Maintenance scripts** | ✅ | ✅ | ❌ | ❌ | ✅ Strong | ➖ |\n| **In-app activity log viewer** | ✅ | ❌ | ❌ | ❌ | ❌ | N/A CLI |\n| **Notarized by Apple** | ❌ | ✅ | ✅ | ✅ | ✅ | N/A |\n| **macOS version** | 14+ | 13+ | 13+ | 13+ | varies | varies |\n\n\u003e CleanMyMac is a great product — they deserve the revenue from users who want a polished, supported experience. Mac Clean is for everyone who'd rather have transparent source code and zero subscription.\n\n## Features\n\n### Cleanup\n| Module | Description |\n|--------|------------|\n| **Smart Scan** | One-click scan combining cleanup, protection, and performance analysis with live progress across 13 modules |\n| **System Junk** | 16 scan categories — user/system caches, logs, language files, broken preferences, broken login items, document versions, iOS backups, Xcode junk, **Universal Binary thinning** (detects fat Mach-O binaries with both arm64 and x86_64 slices and rewrites them to your native arch via `lipo`), deleted users, and more |\n| **Mail Attachments** | Find cached attachments from Apple Mail, Outlook, and Spark |\n| **Trash Bins** | Empty trash from all locations including external drives |\n\n### Protection\n| Module | Description |\n|--------|------------|\n| **Malware Removal** | Signature-based scanning with 3 depths (Quick / Balanced / Deep), checks launch agents/daemons, browser extensions, and known malware patterns |\n| **Privacy** | Clean Safari, Chrome, and Firefox data — history, cookies, cache. System traces cleanup with time filters |\n\n### Performance\n| Module | Description |\n|--------|------------|\n| **Optimization** | Manage login items and launch agents with enable/disable toggles |\n| **Maintenance** | 10 system tasks — free RAM, run maintenance scripts, repair permissions, rebuild Launch Services, reindex Spotlight, flush DNS, thin Time Machine snapshots. Tasks are tagged with severity (safe / disruptive) and \"Run All\" requires explicit confirmation; long-running tasks can be cancelled mid-flight |\n\n### Applications\n| Module | Description |\n|--------|------------|\n| **Uninstaller** | 10-level app matching engine that finds every associated file across 17+ Library subdirectories. Complete removal, app reset, unused app detection |\n| **Updater** | Check for available updates across installed apps via Sparkle appcast feeds |\n\n### Files\n| Module | Description |\n|--------|------------|\n| **Space Lens** | Squarified treemap visualization of disk usage with drill-down navigation |\n| **Large \u0026 Old Files** | Find files \u003e50 MB sorted by size and last access date |\n| **Duplicates** | Progressive detection — size grouping → partial SHA-256 (4KB) → full hash → inode verification |\n| **Shredder** | Secure file erasure with standard, permanent, and secure overwrite modes |\n\n### Menu Bar Widget\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/menu_bar.png\" width=\"300\" alt=\"Mac Clean menu bar widget\" /\u003e\n\u003c/p\u003e\n\nA glassmorphism menu bar widget that puts your Mac's vitals one click away — an independent process that launches at login and is toggled from the app's sidebar. No need to open the main window just to check in.\n\n- **Live stat rings** — CPU load, memory pressure, disk usage, and battery in a 2×2 ring grid (`host_processor_info`, `vm_statistics64`, APFS capacity, IOKit power source), color-graded green → amber → red\n- **Network, uptime \u0026 swap** — real-time up/down throughput, system uptime, and swap usage\n- **Recommendations** — actionable, dismissible tips (\"User caches grew to 2.52 GB — run System Junk\") with one-tap actions, suppressed for 30 days once dismissed\n- **Protection status** — last malware-scan time and threat count, color-coded by freshness\n- **Connected devices** — external volumes (with free space) and external displays at a glance\n- **Health alerts** — background notifications when disk runs critically low or memory pressure stays high (throttled, opt-in)\n- **One click to the app** — jump straight into Mac Clean\n\n## Architecture\n\n```\nMac Clean\n├── MacClean          — Main SwiftUI app (14 modules, 15 views)\n├── MacCleanKit       — Shared framework (models, constants, protocols)\n├── MacCleanHelper    — XPC privileged helper (LaunchDaemon for root ops)\n├── MacCleanMenu      — Menu bar monitor (independent process)\n└── MacCleanTestRunner — Standalone test suite (56 tests)\n```\n\n### Tech Stack\n\n| Layer | Technology |\n|-------|-----------|\n| Language | Swift 6 with strict concurrency |\n| UI | SwiftUI + AppKit hybrid |\n| Concurrency | Actors, TaskGroup, async/await, @Sendable |\n| Database | GRDB.swift (SQLite) with WAL mode |\n| File Scanning | URLResourceKey prefetching on APFS |\n| Incremental Updates | FSEvents with historical replay |\n| Privileged Ops | SMAppService + NSXPCConnection |\n| System Stats | Mach APIs (host_processor_info, vm_statistics64, proc_pidinfo) |\n\n### Safety Model\n\nMac Clean is designed to **never cause data loss**:\n\n- **Protected paths blocklist** — `/System`, `/usr`, `/bin`, `/sbin`, Apple system apps are untouchable\n- **macOS firmlink canonicalization** — `/var`↔`/private/var`, `/tmp`↔`/private/tmp`, `/etc`↔`/private/etc` resolved to a single canonical form so symlink-redirect detection doesn't false-positive on legitimate system paths\n- **Pre-scan cleanability filter** — items the current process couldn't trash (root-owned children of system caches, macOS data-vaulted dirs under `~/Library/Caches/com.apple.*`) are dropped at scan time so they never reach the UI as cleanable\n- **Trash-first deletion** — all removals go to Trash by default\n- **Dry-run mode** — preview what would be deleted without touching anything\n- **TOCTOU prevention** — symlinks re-resolved immediately before deletion\n- **Chunked cleanup** — large selections (50k+) prompt a confirmation modal; the engine splits the work into 5k-item chunks honoring `Task.isCancelled` between chunks so cancellation is responsive\n- **Recursive byte accounting** — directory size is walked instead of stat'd, so the \"X freed\" count on the completion screen reflects reality\n- **Orphan safety policy** — orphan cleanup restricted to caches/logs only\n- **In-app activity log viewer** — every error during clean is logged with full path; the post-clean screen has a \"View Log\" button that opens an in-app sheet with errors-only filter and copy-to-clipboard so you can paste a bug report verbatim. Logs auto-prune after 30 days\n- **Kernel-enforced XPC privilege gate** — the privileged helper uses `NSXPCListener.setCodeSigningRequirement` (macOS 13+) so the kernel itself rejects connections from any process whose code signature doesn't match the main app's identifier and team\n\n## Installation\n\n### Homebrew (recommended — one command, no warnings)\n\n```bash\nbrew tap iliyami/macclean\nbrew install --cask mac-clean\n```\n\nThe Cask automatically handles Gatekeeper for you. Launch from Spotlight or Applications — no warnings, no right-clicks, no commands.\n\n### One-line installer\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/iliyami/MacClean/main/scripts/install.sh | bash\n```\n\nThis downloads the latest DMG, installs the app to `/Applications`, and removes the quarantine flag automatically.\n\n### DMG download\n\nDownload the latest DMG from [Releases](https://github.com/iliyami/MacClean/releases/latest) and drag Mac Clean to your Applications folder. On first launch, either right-click the app and choose **Open**, or run once:\n\n```bash\nsudo xattr -dr com.apple.quarantine \"/Applications/Mac Clean.app\"\n```\n\n### Build from source\n\n```bash\ngit clone https://github.com/iliyami/MacClean.git\ncd MacClean\nswift build\nswift run MacCleanTestRunner   # run 56 tests\nbash scripts/build-dmg.sh      # build local DMG\n```\n\n### Granting Full Disk Access\n\nSome modules (Mail Attachments, Privacy, Malware) need Full Disk Access to scan protected areas:\n\n1. Open **System Settings → Privacy \u0026 Security → Full Disk Access**\n2. Click **+** and add **Mac Clean.app** from Applications\n3. Restart Mac Clean\n\n## Why Mac Clean isn't notarized by Apple\n\nApple charges **$99/year** for a Developer ID — the only way to bypass Gatekeeper warnings on macOS. Mac Clean is free, open-source, and built by volunteers. Paying Apple's annual gatekeeping tax just so users can open the app without a warning isn't worth it when:\n\n1. The source is right here for you to read\n2. Homebrew install handles it automatically — `brew install --cask mac-clean` and you're done\n3. The one-line installer handles it automatically\n4. The whole \"Gatekeeper warning\" thing is just an extra `xattr` command for direct DMG installs\n\nIf our community ever wants to fund a Developer ID (or some other open-source organization wants to sponsor one), we'll happily ship notarized builds. Until then, **no paywall just to launch a free app**.\n\nFor maintainers with a Developer ID who want to ship notarized builds:\n\n```bash\nexport APPLE_DEVELOPER_ID='Developer ID Application: Your Name (TEAMID)'\nxcrun notarytool store-credentials 'MacClean' --apple-id YOU@example.com --team-id TEAMID\nexport NOTARY_PROFILE='MacClean'\nbash scripts/build-dmg.sh --notarize\n```\n\n## Requirements\n\n- macOS 14 (Sonoma) or later\n- For building from source: Swift 6 toolchain (Xcode 16+)\n\n## Project Structure\n\n```\nSources/\n├── MacClean/\n│   ├── App/                    # App entry point, state, content view\n│   ├── Core/\n│   │   ├── Scanner/            # FileTreeScanner, TargetedScanner, ScanCoordinator\n│   │   ├── Cleaner/            # CleaningEngine, SafetyGuard\n│   │   ├── Cache/              # GRDB database layer\n│   │   └── FSMonitor/          # FSEvents incremental watcher\n│   ├── Modules/                # 13 scan modules\n│   │   ├── SystemJunk/         # 16 junk categories\n│   │   ├── Malware/            # Signature scanner + real-time monitor\n│   │   ├── Uninstaller/        # 10-level app matching engine\n│   │   ├── SpaceLens/          # Squarified treemap algorithm\n│   │   ├── Duplicates/         # Progressive hash pipeline\n│   │   └── ...\n│   ├── Views/                  # SwiftUI views (14 module views + shared components)\n│   ├── ViewModels/             # @Observable view models\n│   ├── Services/               # PermissionManager, XPCClient\n│   └── Utilities/              # SuperEllipse shape, extensions\n├── MacCleanKit/                # Shared models, constants, protocols\n├── MacCleanHelper/             # XPC privileged helper (root operations)\n├── MacCleanMenu/               # Menu bar system monitor\n└── MacCleanTestRunner/         # 56 standalone tests\n```\n\n## Tests\n\n```bash\nswift test\n```\n\nXCTest-based suite covering:\n\n- **`SafetyGuard`** — 24 adversarial tests (symlinks, traversal, NULL bytes, SIP, protected apps, file caps, idempotence)\n- **`CleaningEngine`** — 9 integration tests (dry-run, trash, permanent, error handling, operation log)\n- **`PlistJunkFilter`** — 9 tests including Apple-system-domain safety contract\n- **`ScanCoordinator`** state machine — scan/cancel/category-filter/include-heavy\n- **`TargetedScanner`** integration — runs against synthetic temp directory fixtures\n- **All 16 system junk categories** — pure target declarations + the filter logic on the procedural ones (`BrokenPreferences`, `BrokenLoginItems`, `UniversalBinaries`, `DeletedUsers`)\n- **`SquarifiedTreemap`** — empty, single, multi-node, area conservation, aspect-ratio properties\n- **`AppMatching`** — all 10 levels of the uninstaller pattern engine\n- **`DuplicateDetection`** — size groups, partial/full hash groups, inode dedup\n- **`MalwareSignatures`** — name patterns + suspicious launch agent payloads\n- **`MaintenanceTask`** — all 10 tasks have descriptions, icons, executable paths\n- **`FileGroup`** — by-size / by-type / by-age grouping\n- **`AppcastParser`** — Sparkle XML parsing\n- **`VolumeInfo`** — usage math, equality\n- **`AppDatabase`** — GRDB cache CRUD, migrations, invalidation\n- **`FSEventMonitor`** — invalidated-path computation\n- **`AppDiscovery`**, **`AppPathFinder`** — smoke tests\n- **End-to-end** — synthetic fixture → scan → results → clean cycle\n\nTest infrastructure (`Tests/MacCleanTestSupport/`) provides `withTempHome`, `withFakeApp`, `withFakePlist`, and other fixture helpers so tests stay deterministic and never touch the user's real home.\n\nCoverage target: **85%+ overall**, **100% on `SafetyGuard` and `CleaningEngine`** (the death-and-life files). See [`docs/TESTING.md`](docs/TESTING.md) for the full roadmap.\n\n## Security\n\nMac Clean takes security seriously:\n\n- **No network access** — the app never phones home, no telemetry, no analytics\n- **No elevated privileges by default** — XPC helper only activated for maintenance tasks\n- **Code signature verification** — XPC helper validates caller identity\n- **Protected paths** — 27+ Apple system apps and all SIP-protected paths are blocklisted\n- **Open source** — every line of code is auditable\n\n### Security Audit Checklist\n\n- [x] No command injection vectors (all Process args are hardcoded constants)\n- [x] No arbitrary file deletion (SafetyGuard validates every path)\n- [x] TOCTOU race condition prevention (symlink re-resolution before delete)\n- [x] File operation caps (10,000 file limit per operation)\n- [x] XPC caller validation (code signature check)\n- [x] No secrets or credentials in source\n- [x] Trash-first policy (recoverable by default)\n- [x] Operation audit log (every action recorded)\n\n## Contributing\n\nWe welcome contributions! Please read our [Contributing Guidelines](CONTRIBUTING.md) before submitting a PR.\n\n### Quick Start\n\n1. Fork the repo\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests (`swift run MacCleanTestRunner`)\n5. Commit (`git commit -m 'Add amazing feature'`)\n6. Push (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## License\n\nThis project is licensed under the **BSD 3-Clause License** — see the [LICENSE](LICENSE) file for details.\n\nThis means you can use, modify, and redistribute this code, but you **must**:\n- Include the original copyright notice\n- Include the license text\n- **Not** use the name \"Mac Clean\" or contributors' names to endorse derived products without permission\n\n## Acknowledgments\n\nInspired by the open-source Mac utility community:\n- [Pearcleaner](https://github.com/alienator88/Pearcleaner) — app uninstaller patterns\n- [Mole](https://github.com/tw93/Mole) — cleanup categories\n- [Tencent Lemon Cleaner](https://github.com/Tencent/lemon-cleaner) — modular architecture\n- Squarified Treemap algorithm by Bruls, Huizing \u0026 van Wijk (2000)\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eMac Clean is free software built by the community, for the community.\u003c/strong\u003e\u003cbr\u003e\n  If you find it useful, please star the repo and share it with others.\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filiyami%2FMacClean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filiyami%2FMacClean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filiyami%2FMacClean/lists"}