7

In all of my stupidity I've notice I misspelled my own project. I'm honestly scared to rename it in Mac due to certain filepaths referencing folders that now do not exist. Is there an easy way to rename a project?

Joey Cadle
  • 188
  • 1
  • 3
  • 11
  • create a backup first may be ? and what do you mean by "due to certain filepaths referencing folders that now do not exist" ? how does your project function properly if they dont exist anymore. a bit not clear on that part – nsuinteger Apr 03 '14 at 02:47
  • 1
    Just create a new project with the correct name, it's much easier and starts you out at a clean slate so to speak. (Backup your current project folder first! Cmd + D) Then migrate your storyboard(s) asset catalog, and code files over. – klcjr89 Apr 03 '14 at 02:59
  • What's the real problem? The name of the project is not something anyone ever sees. If you want to change the name of the _app_ as the user will see it, just confine yourself to that (it's part of the Info.plist). – matt Apr 03 '14 at 04:17
  • Possible duplicate of [How to change the name of an iOS app?](https://stackoverflow.com/questions/238980/how-to-change-the-name-of-an-ios-app) – midhun p Oct 01 '18 at 12:05

5 Answers5

5

Try refactoring, It should work fine, if it doesn't refactoring creates a snapshot instantly.

  1. In Xcode, go to the navigator panel and select the target:

enter image description here

  1. Go to the inspector panel (on the far right) and select the File Inspector icon. You can change the project name here. (You will get a pop-up dialogue to confirm the changes.)

enter image description here

so try it out, if it blows up restore, and create a new project, and migrate to the new one slowly (as @troop231) mentioned.

good luck!

source

MrHaze
  • 3,786
  • 3
  • 26
  • 47
3

I've posted this as an answer elsewhere, but this works like it should...

This is a four step change. And is a real pain

Step 0 - Backup your existing project

  1. Quit Xcode
  2. Right click the master folder containing the project file and the assets, select archive
  3. This will create you an archive of the OLD project
  4. Open the OLD project in Xcode again

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 OLD name of your project should be in there under “Identity and Type”, change it to the new name.
  3. A drop down appears, with a “rename” ok box
  4. Click rename.

Step 2 - Rename the Scheme

  1. In the top bar, just by the “Stop” button, is the scheme for your OLD product, click this then “manage schemes”
  2. Click on the OLD name in the scheme, and it will become editable, change the name. (If you click it twice, you go into the editor (which you don’t want) click the manage schemes button to get back again)

Step 3 - Rename the folder with your assets

  1. Quit out of Xcode
  2. In the correctly named master folder, there is your newly named xcodeproj file with the the wrongly named OLD assets folder. Rename the OLD folder to your new name
  3. Reopen the project and you get a warning “The folder OLD does not exist”, dismiss the warning
  4. On the left in the “project navigator” click the top level OLD folder name.
  5. On the right in the “file navigator” under “Identity and type” you will see the “Name” entry, change this from the OLD to the new name
  6. Just under this is the “location” entry, just below that is a folder symbol with the OLD name. click this and chose the newly renamed folder

Step 4 - Rename the Build plist data

  1. Click on the project in the “project inspector” on the left, in the centre panel select “Build Settings”
  2. in this section search for plist
  3. Under packaging, you will see Info.plist, and Product bundle identifier.
  4. In Info.plist rename the OLD entry
  5. In the Product Identifier and rename the OLD entry

FINALLY you are done and can rebuild (Apple-key+shift+k clean, Apple-Key+b then build)

Luke West
  • 14,183
  • 1
  • 16
  • 8
2

I've found myself in these situations many times and this is what has helped me without any issues. https://github.com/shabbirh/Xcode-Project-Renamer

There are many options out there, a few works, others don't.

Follow this and you can enjoy a cold or hot drink instead of fighting with the Xcode rename process.

  • Install dependency
  • Run the command

gem install xcode-project-renamer

And then lookup for the ProjectToBeRenamed.xcodeproj file

cd yourParentProject/
xcode-project-renamer ProjectToBeRenamed NewProjectName

# Verbose information here.
# at the end you would see
Done.

I hope this helps others.

mayoralito
  • 86
  • 3
0

If you've just started it's easiest to just create a new project with the correct name, then delete the old one. We (I) do this all the time.

Aaron
  • 7,055
  • 2
  • 38
  • 53
0

To change Project name go through this scenario.

Select target

enter image description here

Select Build Settings

enter image description here

Search product name here

enter image description here

Then Change the new App name here

enter image description here

please note that the XCODE project name will not change but when you run the App name will be change

enter image description here

Vineesh TP
  • 7,755
  • 12
  • 66
  • 130