feat(clean): remove stale iOS/iPadOS .ipsw software updates#693
Merged
feat(clean): remove stale iOS/iPadOS .ipsw software updates#693
Conversation
Add clean_ios_software_updates that removes cached firmware installers
from ~/Library/iTunes/{iPhone,iPad,iPod} Software Updates. These are
5-8GB .ipsw files already consumed by the device; macOS re-downloads
them on demand. Backups under MobileSync are never touched.
Follows the clean_chrome_old_versions pattern: dry-run aware,
whitelist-respecting, integrated into the Device backups section
alongside check_ios_device_backups.
Address tw93 follow-up nits on the initial ipsw cleanup: - Rename function to clean_cached_device_firmware and section to 'Device backups & firmware' (ipsw is firmware, not a backup) - Extend coverage to Apple Configurator 2 nested firmware cache under ~/Library/Group Containers/*.group.com.apple.configurator (was missed) - Register whitelist sentinels in manage/whitelist.sh so users can discover and protect the paths through the whitelist UI - Add dry-run test that uses real safe_remove (no mock) to verify the filesystem stays untouched in preview mode - Add Configurator 2 fixture test
6bd81d4 to
ac6ee19
Compare
Owner
|
@sebastianbreguel thanks for this. I kept the feature, pushed a small maintainer follow-up so the cleanup stats only count successful removals, and merged it now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
clean_cached_device_firmware()that removes cached.ipswfirmware installers from~/Library/iTunes/{iPhone,iPad,iPod} Software Updates/and Apple Configurator 2's nested cache under~/Library/Group Containers/*.group.com.apple.configurator/..ipsw= full iOS/iPadOS firmware image (~5–8GB each) dropped by Finder/iTunes when you restore or update a device over cable, or by Apple Configurator 2 when managing device fleets. Once applied they're dead weight — Apple re-downloads on demand.Who this actually helps
Honest scope: probably <10% of users have any
.ipswon disk (OTA updates from the device itself don't touch the Mac). But when the files are there, the win is huge:For the other 90% it's a silent no-op (one
findatmaxdepth 1, negligible cost). Same profile as Xcode DeviceSupport cleanup (#519): nicho, pero cuando aplica se liberan decenas de GB.Before / After
Before — firmware files sit unused, eating disk:
After — firmware removed, backups still respected:
User with no cached firmware (majority case):
Design choices
MobileSync/— only.ipswfiles at the firmware pathsclean_chrome_old_versionspatternmanage/whitelist.shso users discover and protect the paths viamo clean --whitelist:Device backupstoDevice backups & firmware(firmware isn't a backup)Test plan
bats tests/clean_cached_device_firmware.bats— 6/6 pass.ipswunder Apple Configurator 2 Group Containersafe_remove(no mock) leaves filesystem untouchedRegression:
bats tests/clean_browser_versions.bats tests/clean_user_core.batsall greenVerified no-op path on a real Mac with zero
.ipswfiles (no false positives, no errors)Manual validation on real Mac: created 10MB fixture
.ipsw, ran./mo clean --dry-run, verified output:Fixture cleaned up after test.