Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename xcode project

Tags:

xcode

ios

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?

like image 738
Joey Cadle Avatar asked Apr 03 '14 02:04

Joey Cadle


2 Answers

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

like image 140
MrHaze Avatar answered Oct 09 '22 14:10

MrHaze


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)

like image 30
Luke West Avatar answered Oct 09 '22 14:10

Luke West