I’ve used shell commands to rename projects a few times, and it worked better than renaming from Xcode itself. Here are the steps (given we want to rename warnings_test => BestAppEver) (you may need to install a few extra tools with brew install rename ack):
Find all files with name containing the source string:
$ find . -name 'warnings_test*' -print0 | xargs -0 rename --subst-all 'warnings_test''BestAppEver'Can't rename './warnings_test.xcodeproj/xcshareddata/xcschemes/warnings_test.xcscheme' to './BestAppEver.xcodeproj/xcshareddata/xcschemes/BestAppEver.xcscheme': No such file or directoryCan't rename './warnings_test.xcodeproj/xcshareddata/xcschemes/warnings_testTests.xcscheme' to './BestAppEver.xcodeproj/xcshareddata/xcschemes/BestAppEverTests.xcscheme': No such file or directory
Can't rename './warnings_testTests/warnings_testTests.m' to './BestAppEverTests/BestAppEverTests.m': No such file or directory
You’ll need to run this command a couple of times, because directories will be renamed first, then files and directories inside those will be renamed on the next iteration. Check with the step 1 if all the files are renamed (should see empty output):
One run is enough, there should be no output. To verify, run the command in step 3 again, you should see empty output.
Open the renamed project:
1
$ open BestAppEver.xcodeproj
Builds great!
Done! All your targets, schemes, files, mentions in comments, identifiers, names, etc. have been renamed. If you git add . and git status, you should see a lot of renamed: entries (just another sanity check):
1234567891011121314151617
$ git status
## masterR warnings_test.xcodeproj/project.pbxproj -> BestAppEver.xcodeproj/project.pbxproj
R warnings_test.xcodeproj/project.xcworkspace/contents.xcworkspacedata -> BestAppEver.xcodeproj/project.xcworkspace/contents.xcworkspacedata
R warnings_test.xcodeproj/xcshareddata/xcschemes/warnings_test.xcscheme -> BestAppEver.xcodeproj/xcshareddata/xcschemes/BestAppEver.xcscheme
R warnings_test.xcodeproj/xcshareddata/xcschemes/warnings_testTests.xcscheme -> BestAppEver.xcodeproj/xcshareddata/xcschemes/BestAppEverTests.xcscheme
R warnings_test/AppDelegate.h -> BestAppEver/AppDelegate.h
R warnings_test/AppDelegate.m -> BestAppEver/AppDelegate.m
R warnings_test/Base.lproj/LaunchScreen.xib -> BestAppEver/Base.lproj/LaunchScreen.xib
R warnings_test/Base.lproj/Main.storyboard -> BestAppEver/Base.lproj/Main.storyboard
R warnings_test/Images.xcassets/AppIcon.appiconset/Contents.json -> BestAppEver/Images.xcassets/AppIcon.appiconset/Contents.json
R warnings_test/Info.plist -> BestAppEver/Info.plist
R warnings_test/ViewController.h -> BestAppEver/ViewController.h
R warnings_test/ViewController.m -> BestAppEver/ViewController.m
R warnings_test/main.m -> BestAppEver/main.m
R warnings_testTests/warnings_testTests.m -> BestAppEverTests/BestAppEverTests.m
R warnings_testTests/Info.plist -> BestAppEverTests/Info.plist