https://stackoverflow.com/questions/33370175/how-do-i-completely-rename-an-xcode-project-i-e-inclusive-of-folders


764

Step 1 - Rename the project

  1. Click on the project you want to rename in the "Project navigator" on the left of the Xcode view.
  2. On the right select the "File inspector" and the name of your project should be in there under "Identity and Type", change it to the new name.
  3. Click "Rename" in a dropdown menu

Step 2 - Rename the Scheme

  1. In the top bar (near "Stop" button), there is a scheme for your OLD product, click on it, then go to "Manage schemes"
  2. Click on the OLD name in the scheme, and it will become editable, change the name

Step 3 - Rename the folder with your assets

  1. Quit Xcode
  2. In the correctly named master folder, there is a newly named xcodeproj file with the wrongly named OLD folder. Rename the OLD folder to your new name
  3. Reopen the project, you will see a warning: "The folder OLD does not exist", dismiss the warning
  4. In the "Project navigator" on the left, click the top level OLD folder name
  5. In Utilities pane under "Identity and type" you will see the "Name" entry, change this from the OLD to the new name
  6. Just below there is a "Location" entry. Click on a folder with the OLD name and chose the newly renamed folder

Step 4 - Rename the Build plist data**

  1. Click on the project in the "Project navigator" on the left, in the main panel select "Build Settings"
  2. Search for "plist" in this section
  3. Under packaging, you will see Info.plist, and Product bundle identifier
  4. Rename the top entry in Info.plist
  5. Do the same for Product Identifier

Step 5 - Repeat step 3 for tests (if you have them)**

Step 6 - Repeat step 3 for core data if it's name matches project name (if you have it)**

Finally, you are done and can rebuild (Command + Shift + K to clean, Command + B to build)

  • 3
    You are able to change the name of project but the folders names are still the same. Do you know how to change those – Coder221 Sep 15 '16 at 4:55
  • 43
    When doing step 3 part 2 (renaming the folder), if you're using git, I recommend git mv oldname newname, that way git will recognize that it was a move, not deleting and adding all your files. – Aaron Ash Nov 22 '16 at 11:14
  • 3
    Thank you! It works for me! Xcode 8.2 – Leo Dec 27 '16 at 3:07 
  • 10
    perfect, works perfectly in Xcode 8.2, just one thing to point out here while editing the scheme if clicking on the scheme name once doesn't make it editable then select the scheme and hit return key this will make the scheme name editable. – Khurram Shehzad Jan 31 '17 at 5:47
  • 3
    Don't forget to find & replace other instances of your old project name. – Derek Soike Feb 6 '17 at 17:37
157

To add to @luke-west 's excellent answer:

When using CocoaPods

After step 2:

  1. Quit XCode.
  2. In the master folder, rename OLD.xcworkspace to NEW.xcworkspace.

After step 4:

  1. In XCode: choose and edit Podfile from the project navigator. You should see a target clause with the OLD name. Change it to NEW.
  2. Quit XCode.
  3. In the project folder, delete the OLD.podspec file.
  4. rm -rf Pods/
  5. Run pod install.
  6. Open XCode.
  7. Click on your project name in the project navigator.
  8. In the main pane, switch to the Build Phases tab.
  9. Under Link Binary With Libraries, look for libPods-OLD.a and delete it.
  10. If you have an objective-c Bridging header go to Build settings and change the location of the header from OLD/OLD-Bridging-Header.h to NEW/NEW-Bridging-Header.h
  11. Clean and run.
  • 5
    Using Xcode 8.3.2 I had to use cocoapods-deintegrate and reinstall all pods to run the project with the new name. – SteffenK Jun 1 '17 at 23:42
  • 1
    @SteffenK is there a differemce between that method and rm -rf Pods/ ? Considering that you've done all the other steps? – Vaiden Jun 3 '17 at 17:17
  • 1
    Would you elaborate please? What traces? – Vaiden Jun 3 '17 at 21:38 
  • 2
    @Vaiden thank you so much for the extra clarity when working with CocoaPods! The process did create a second reference, which was strange, but after removing it everything was working perfectly! Thanks again! :) – Matt Swift Jun 12 '17 at 14:09
  • 4
    Could somebody tell me where I can find the OLD.podspec file that is mentioned in this answer? In my project I got a few files like 'Podfile'/'Podfile.lock'/'Pods.xcodeproj' and I got an empty folder named 'Local Podspecs', but I cannot find an .podspec file – codeDude Aug 22 '17 at 10:42
28

A quicker solution using shell commands (works with CocoaPods too):

PLEASE cd TO A NON-GIT REPOSITORY BEFORE PROCEEDING ⚠️

Step 1 - Prerequisites

  1. Copy your original project folder to a temporary /NewProjectFolder OUTSIDE your git repository. ⚠️ changes to .git could corrupt your git index