(iOS) Rename your Xcode Project

Kenta Kodashima
3 min readJul 19, 2018

--

When you make an app, you might feel like renaming the app name before you publish it. For me, the process was a bit more complicated than I thought. In this article, I try to summarize all the process I needed to take to rename the app.

1. Change the names manually

First, you need to rename the project name with the blue file icon manually.

Rename the project file

Then the pop-up like below shows up. Just click ‘Rename’ button.

Rename pop-up

2. Rename the scheme

Next, you need to rename the project scheme. Go to ‘Menu bar > Product > Scheme > Manage Schemes’ and rename the Scheme name manually.

Rename scheme name

3. Rename the main files

At this point, the project names in your project folder are still old. To change the names, go to open your ‘Terminal’ and move to your project directory using ‘cd’ command. Then simply add the code below.

mv OldProjectName NewProjectName

4. Replace all occurrences of your old project’s name

Now the project folder name has been replaced. Then you want to rename all the occurrences of your old project names in your files. In order to do that, execute the command below on your Terminal.

NOTE:
It might bring up the pop-up window in Xcode saying ‘Revert’ or ‘Keep Xcode version’.
In that case, choose ‘Revert’ to update the names.

grep -Rl "YourOldProjectName" * | xargs sed -i "" "s/YourOldProjectName/YourNewProjectName/"

5. Rename the project name in your Podfile

If you’re using ‘Cocoapods’ in your app, you also need to update your ‘Podfile’.
Replace the old project names in your Podfile with the new one and install.

Note:
The names beside ‘project’ and ‘target’ might have been already changed at this point.

Podfile

6. Build and Run

When you try to build, you might face an error here. If you see an error like below, just click on the project name with the blue icon and go to ‘Your project name under TARGETS > General > Linked Frameworks and Libraries’ section. If you find ‘Pods_YourOldProjectName.framework’, just delete that row.

Error message
Linked Frameworks and Libraries section

That’s everything!

Reference:

--

--

Kenta Kodashima
Kenta Kodashima

Written by Kenta Kodashima

I'm a Software Engineer based in Vancouver. Personal Interests: Books, Philosophy, Piano, Movies, Music, Studio Ghibli.

No responses yet