How to Rename XCode Project Source Folder

I have previously wrote about how to rename a project in XCode. But this time we’ll talk about how to rename the source folder of any project. Renaming the project in XCode only rename within XCode, but it does not rename the folder in the filesystem.

Note: Before doing any changes do backup your project folder. This is seriously recommended.

Follow the steps below to rename the source folder of your project –

  1. Close XCode.
  2. Rename the source folder.
  3. Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor.
  4. Search and replace any occurrence of the original folder name with the new folder name.
  5. Save the file.
  6. Open XCode project.
Namit Gupta

Technical Lead iOS @ONEChampionship | Ex-SDE2 @ Halodoc, Ex-iOS Lead @ Vokal. ❤️ Swift, designing pixel-perfect UI and writing clean code. Check my portfolio here.

Leave a Reply