CLI tool to automatically clean Xcode derived data with scheduled cleanup
npm install xcode-cleanupA simple CLI tool to automatically clean Xcode derived data with scheduled cleanup support.
``bash`
npm install -g xcode-cleanup
Or use directly with npx:
`bash`
npx xcode-cleanup
Set up automated scheduled cleanup of Xcode derived data. This will guide you through an interactive prompt to choose:
- Frequency: Daily, Weekly, or Monthly
- Day: Which day (for weekly/monthly schedules)
- Hour: What time (24-hour format)
After selecting your preferences, you can choose to:
- Add the command to crontab manually
- Create a launchd plist file (macOS recommended)
- Skip automated setup
`bash`
xcode-cleanup init
Immediately remove all Xcode derived data from ~/Library/Developer/Xcode/DerivedData.
`bash`
xcode-cleanup remove
The init command creates a schedule configuration saved to ~/.xcode-cleanup-schedule.json. You can then set up automation using either:
1. Crontab: Traditional Unix scheduling
2. Launchd (macOS): Native macOS scheduling with plist files
`bashSet up daily cleanup at 2 AM
xcode-cleanup init
Development
`bash
Install dependencies
npm installRun locally
node src/index.js --help
``