How to use an existing iOS project to start a new one (renaming) [XCode 8.1]

So after I spend a bunch of time trying to make it work.. here’s how for future reference and in case anyone else is struggling..

  1. With XCode closed, copy the desired folder and rename it to the new project name. Double click on [oldprojectname].xcodeproj to start XCode.
  2. On the hierarchy tree on the left pane, rename the root file (the one with the blue paper icon). You’ll get a popup asking if you want to rename more files, accept the change.
  3. Next to the “play button” click on the old project name (this is the scheme) and select Manage schemes. On the next window, rename the scheme.
  4. On the left pane, click on the yellow root folder that still reads the old project name and rename it to the new project name.
  5. Select the folder on the left pane that you just renamed and open the right pane. On the right pane, there is a section identity and Type. Under Location, there is a folder icon, click on that and, on the finder window, select the inner root folder that still contains the old project name. Rename that file aswell, unselect it at reselect it. Now click on choose to go back to XCode.
  6. On the left pane, check for any files in red, like Imagex.xcassets and resources. Select them and again, in the right pane click on the folder icon once again to reselect the files under their new path. Another method is to delete the files and re add them by dragging from the finder.
  7. Click on the root file with the blue icon in the left pane and select the file under Project section. Click on the Build Settings tab and search for “Prefix Header”.
  8. Under Precompile Prefix Header select Yes and expand Prefix Header. Enter the following on Debug and Release:
    $(SRCROOT)/$(PROJECT_NAME)/ProjectName-Prefix.pch

    9. Now on the left under Targets select your project name. Still on Build with Prefix Header searched, change Precompile Prefix Header to Yes and expand Prefix Header to fix the paths.

  9. Still in targets, search for “Info.plist” and fix the path.
  10. Finally, still in targets, select the tab General and change the package name.

One comment

  1. Anne says:

    Very good article, thanks.It allowed me to do exactly what I tried to do since ages !

Leave a Reply to Anne Cancel reply

Your email address will not be published.