Skip to content

Instantly share code, notes, and snippets.

@psksvp
Last active January 26, 2020 04:37
Show Gist options
  • Save psksvp/ad1db06d61b9756d51f5b27cc360ba6e to your computer and use it in GitHub Desktop.
Save psksvp/ad1db06d61b9756d51f5b27cc360ba6e to your computer and use it in GitHub Desktop.
Rename Xcode project (11.3.1 (11C504))
I put in the make file from https://stackoverflow.com/questions/33370175/how-do-i-completely-rename-an-xcode-project-i-e-inclusive-of-folders
It was originally written by https://stackoverflow.com/users/7641654/pietro-basso
__USE AT YOUR OWN RISK, ALWAYS BACK UP before doing this. You must read the post before using this.__
The makefile needs `ack` and `rename` which can be install with `brew install ack rename`
put this file the project directory then run `make -f renameXcode.makefile OLD_NAME="oldname" NEW_NAME="newname"`
## rename xocde project
## make -f renameXcode.makefile OLD_NAME="oldname" NEW_NAME="newname"
all:
find . -name '$(OLD_NAME)*' -print0 | xargs -0 rename --subst-all '$(OLD_NAME)' '$(NEW_NAME)'
find . -name '$(OLD_NAME)*' -print0 | xargs -0 rename --subst-all '$(OLD_NAME)' '$(NEW_NAME)'
ack --literal --files-with-matches '$(OLD_NAME)' --print0 | xargs -0 sed -i '' 's/$(OLD_NAME)/$(NEW_NAME)/g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment