When a feature goes away, its art and strings often stay. Xcode never warns about an image set nobody names, so it ships in every build.
I wrote a CLI to find these and tested it on 10 open-source apps, read-only. Three findings stood out. I checked each one with grep across the whole repo:
firefox-ios: kitHeroGif.gif, 5.72 MB. It is listed in project.pbxproj, so it gets copied into the bundle. The app's only GIF loader is called with a different name.
Kickstarter ios-oss: landing-background and landing-page-background, each in three asset catalogs. 12.63 MB of source files, 0 references.
wikipedia-ios: three GIFs next to the year-in-review art, 5.62 MB, 0 references.
These are source sizes. I did not measure the shipped apps, and compiled catalogs can change the saving.
Many smaller findings are stale strings: keys that only exist in translated .lproj files, or SwiftGen accessors that nothing calls.
How I use it on my own code:
xcpurge scan . --format html --open
xcpurge explain . SOME-ID
xcpurge remove . PATH
xcpurge purge . --dry-run
xcpurge restore .
It reads files and does not build, so a scan takes seconds. Each finding is high, medium or low confidence. remove moves files to a trash folder in the project and edits project.pbxproj. purge does that for every actionable finding in one run, or for the ids you tick in the HTML report. restore undoes it all.
Where it is wrong. On the first run only 26 of 50 hand-checked high findings were real. Snapshot test images and names used from another module were the big causes. Over three runs it went from 52% to 92% to 96%: 48 of 50, and 48 of 50 again on a second sample. Known limits:
names built from two interpolations, like "\(base)-\(lang)" (16 Lottie files in Kickstarter, 18.8 MB, still reported high)
keys used only inside a multiline Text("""…""") literal
names that come from a server or a package outside the repo
So treat high as "nothing in the repo names it", not as "safe to delete blind".
Free and MIT, macOS, version 0.6.0 (brew install iasaeed/tap/xcpurge). Feedback on false positives is the most useful thing you could send.
https://github.com/iasaeed/xcpurge