A macOS app to help you clean up disk space by scanning and removing unnecessary files from common directories like Xcode DerivedData, browser caches, system caches, and more.
- Smart Directory Scanning: Automatically scans common directories that accumulate large files
- Tag-based Filtering: Filter directories by categories (xcode, system, browser, dev, gaming, etc.)
- Size Display: Shows the size of each directory after scanning
- Safe Cleaning: Deletes contents of directories while preserving the directory structure
- JSON Configuration: Easy to add new directories via pull requests
- macOS 14.0 or later
- Xcode 15.0 or later
-
Clone the repository
git clone https://github.com/yourusername/cupertino-clean.git cd cupertino-clean -
Open in Xcode
open CupertinoClean.xcodeproj
-
Build and Run
- Press
Cmd + Rin Xcode, or - Click the "Play" button in Xcode toolbar
- The app will launch and you can start scanning directories
- Press
- Scan Directories: Click "Scan Cleanable Files" to analyze all directories
- Filter by Tags: Use the tag buttons to filter directories by category
- Select Directories: Check the directories you want to clean
- Clear Selected: Click "Clear all" to delete contents of selected directories
The app scans these common directories that accumulate large files:
- Xcode DerivedData: Build artifacts and intermediate files
- Xcode iOS Device Support: Device-specific build files
- Xcode Archives: App archives and distribution files
- Xcode Core Simulator: iOS Simulator data
- User Library Caches: Application cache files
- System Library Caches: System-level cache files
- Chrome Cache: Browser cache files
- Safari LocalStorage: Browser storage files
- Homebrew Cache: Package manager cache
- npm Cache: Node.js package cache
- CocoaPods Cache: iOS dependency cache
- Downloads: User download folder
- Trash: Deleted files
CupertinoClean uses a JSON configuration file to manage the list of directories to scan. This makes it easy for contributors to add new directories via pull requests.
- Edit the JSON file: Open
CupertinoClean/Resources/directories.json - Add a new directory object: Each directory should have:
path: The directory path (use~for home directory)name: A human-readable name for the directorytags: Array of tags for filtering (e.g.,["xcode"],["system"],["browser"])
{
"path": "~/Library/Developer/Xcode/DerivedData",
"name": "Xcode Derived Data",
"tags": ["xcode"]
}xcode: Xcode-related directoriessystem: System cache and temporary filesbrowser: Browser cache and storagedev: Development tool cachesgaming: Game-related filesvm: Virtual machine filesuser: User-specific files
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b add-new-directory
- Make your changes to
directories.json - Test your changes by building and running the app
- Commit and push:
git add CupertinoClean/Resources/directories.json git commit -m "Add new directory: [Directory Name]" git push origin add-new-directory - Create a Pull Request on GitHub
- Safety First: Only include directories that are safe to clean
- Common Use Cases: Focus on directories that commonly accumulate large files
- Clear Naming: Use descriptive names that users will understand
- Proper Tagging: Use appropriate tags for easy filtering
- Test Thoroughly: Verify the directory exists and is safe to clean
# Build the project
xcodebuild -project CupertinoClean.xcodeproj -scheme CupertinoClean -configuration Debug build
# Run the app
open build/Debug/CupertinoClean.appUse the provided build script:
./build.sh- The app only deletes contents of directories, not the directories themselves
- This preserves system functionality while freeing up space
- Always review what will be deleted before clicking "Clear all"
- The app includes safety checks to prevent accidental deletion of important files
-
"Could not find directories.json"
- Ensure the JSON file is properly included in the Xcode project
- Check that the file path in DirectoryLoader.swift is correct
-
Permission Denied
- Some system directories require administrator privileges
- The app will log errors for directories it cannot access
-
Build Errors
- Ensure you're using Xcode 15.0 or later
- Clean build folder:
Cmd + Shift + Kin Xcode - Reset package caches if using Swift Package Manager
This project is open source and available under the MIT License.
- Issues: Report bugs or request features on GitHub Issues
- Contributions: Submit pull requests for new directories or improvements
- Discussions: Use GitHub Discussions for questions and ideas