MacTreeSize is a powerful, native macOS application designed to help you visualize and manage your disk space usage. Inspired by classic disk usage tools, it provides a clean, modern SwiftUI interface to quickly identify large files and folders that are consuming your storage.
- 🚀 Fast & Efficient Scanning: Uses Swift's structured concurrency and actors for high-performance, non-blocking file system scanning.
- 📊 Visual Analysis:
- Hierarchical List: Drill down into folders to see exactly where space is being used.
- Distribution Charts: Interactive bar charts powered by Swift Charts to visualize file distribution.
- 📂 File Management:
- Reveal files directly in Finder.
- Move unwanted files/folders to the Trash directly from the app.
- ⭐ Favorites: Bookmark frequently accessed locations for quick re-scanning.
- 🔍 Filtering: Filtering capabilities to find specific file types or large items (Implied by code structure).
- 🖥️ Native macOS UI: Built completely with SwiftUI, supporting Dark Mode and standard macOS behaviors.
- macOS: 14.0 (Sonoma) or later.
- Xcode: 15.0 or later (to build the project).
- Launch MacTreeSize.
- Click the Scan button (Play icon) in the toolbar.
- Select a folder or disk volume you want to analyze.
- The scan will start immediately. You can view progress in real-time.
- Navigate through the folder structure in the list view.
- Use the Visualization View at the bottom to see a graphical representation of the selected folder.
- Open in Finder: Right-click a file/folder and select "Show in Finder".
- Delete: Right-click and select "Move to Trash".
- Stop Scan: Click the "Stop" button in the toolbar to cancel an ongoing operation.
To build and run MacTreeSize locally, follow these steps:
git clone https://github.com/yourusername/MacTreeSize.git
cd MacTreeSizeOpen the project file using Xcode:
open MacTreeSize.xcodeproj- Ensure the target MacTreeSize is selected in the top bar.
- Select your Mac ("My Mac") as the destination.
- Press Cmd + R or click the Run button (Play icon) in Xcode.
To create a standalone application file (.app):
- In Xcode, go to Product > Archive.
- Once the archive is created, the Organizer window will open.
- Select the latest archive and click Distribute App.
- Choose Copy App (for personal use) or TestFlight / App Store Connect (for distribution).
- Follow the prompts to export the application.
MacTreeSize is built using modern Swift principles:
- MVVM (Model-View-ViewModel): Separates UI logic from business logic.
- SwiftUI: Declarative user interface.
- Structured Concurrency: Uses Swift Actors (
FileScanner) to handle file I/O operations safely on background threads without freezing the UI. - FileNode System: A reference-based recursive data structure optimized for handling large file trees.
MacTreeSize/: Main source code.Views/: SwiftUI views (ContentView,SidebarView,DistributionView).ViewModels/: Logic controllers (ContentViewModel).Models/: Data structures (FileNode,ScanStatistics).Services/: core engines (FileScanner,VolumeScanner).
For a more detailed deep-dive, see docs/PROJECT_STRUCTURE.md.
Contributions are welcome! If you'd like to improve MacTreeSize:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
