xcutility is a tool to find and delete unused files from Xcode projects.
It recursively searches through a path to find all of the path's Xcode projects and files, and will tell you which files are not referenced or built in any of your Xcode projects.
You can install xcutility by downloading xcutility.pkg
from the
latest GitHub release and
running it.
You can also build from source by cloning this project and running
make install
(Xcode 10.2 or later).
-
Find Swift files not referenced in any Xcode projects:
xcutility norefs --extensions .swift
-
Find Objective C files not referenced in any Xcode projects:
xcutility norefs --extensions .m,.h
-
Find Swift & Objective C files not referenced in any Xcode projects:
xcutility norefs --extensions .m,.h,.swift
-
Find Swift files not compiled in any Xcode projects:
xcutility unbuilt --extensions .swift
-
Find Objective C files not compiled in any Xcode projects:
xcutility unbuilt --extensions .m
-
Find Swift & Objective C files not compiled in any Xcode projects:
xcutility unbuilt --extensions .m,.swift
$ xcutility help
Available commands:
all Find files that are not built or referenced in any Xcode projects
help Display general or command-specific help
norefs Find files that are not referenced in any Xcode projects
unbuilt Find files that are referenced in Xcode but not built in any build phases
version Display the current version of xcutility
xcutility norefs
xcutility norefs --path ~/MySweetSweetApp/
xcutility norefs --extensions .swift
xcutility norefs --extensions .swift,.h,.m
xcutility norefs --extensions .swift,.h,.m --delete
xcutility norefs --verbose
xcutility norefs --path ~/MySweetSweetApp/ --extension .swift,.h,.m --verbose --delete
xcutility unbuilt
xcutility unbuilt --path ~/MySweetSweetApp/
xcutility unbuilt --extensions .swift
xcutility unbuilt --extensions .swift,.h,.m
Find And Delete Files With Multiple Extensions that are not built by any Xcode Projects Build Phases
xcutility unbuilt --extensions .swift,.m --delete
xcutility unbuilt --verbose
xcutility unbuilt --path ~/MySweetSweetApp/ --extension .swift,.m --verbose --delete
xcutility is released under the MIT license.