Skip to content

Instantly share code, notes, and snippets.

@jkatayama
Last active May 22, 2017 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkatayama/8fb68b672f2894943019 to your computer and use it in GitHub Desktop.
Save jkatayama/8fb68b672f2894943019 to your computer and use it in GitHub Desktop.

Rename Xcode Project

1.Rename project from Xcode

2.Rename scheme

  • Most sites tell you only two steps avobe, but that's not enough to rename evrything. Since the original project name also exsists in .phxproj file and .xcuserstate file, you cannot modify these files from Xcode.
  • To solve the problem, you can use grep command.

3.Go to your project directory

4.List all lines containing the original project name from the current directory

$ grep -R "<OriginalName>" .

5.Rename them

$ grep -Rl "<OriginalName>" * | xargs sed -i "" "s/<OriginalName>/<NewName>/"

6.Don't forget to rename your project's root directory

7.Try alternative way

$ find . -name '<OriginalName>*' -print0 | xargs -0 rename -S '<OriginalName>' 'JsBar'
$ ack --literal --files-with-matches '<OriginalName>' | xargs sed -i '' 's/<OriginalName>/<NewName>/g'
$ ack --literal '<OriginalName>'

http://jslim.net/blog/2015/01/08/how-to-rename-xcode-project-thoroughly/

@jkatayama
Copy link
Author

$ grep -R "ProjectName" causes grep: warning: recursive search of stdin error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment