I have a project named XXX
. I want to rename this project to YYY
.
Note that XXX
is an extremely common term (for e.g. "data", or simply "project"), and thus a simple RegEx search-and-replace is not possible, out of risk of corrupting the project configuration files.
My current project directory contains the following items:
XXX
XXXTests
XXX.xcodeproj
and I want to rename them to:
YYY
YYYTests
YYY.xcodeproj
... respectively, with the necessary changes being reflected in my project file.
How can I accomplish this without having to manually create and populate a new project?
xcodeproj to TextWrangler (or any text editor) « Use find button to find "FolderName" (Your folder name) « Replace all with new name. « In some project you may notice header search path problem...goto header search path and replace with new name. Method_2.
Right click the namespace → Rename.... This should search and replace all references to your namespace throughout the project. Close the project → rename the project folder.
Duplicating an Xcode ProjectIn Xcode, rename the project. Select your project from the navigator pane (left pane). In the Utilities pane (right pane) rename your project, Accept the changes Xcode proposes. In Xcode, rename the schemes in "Manage Schemes", also rename any targets you may have.
git mv oldname newname
so that Git recognizes this is a move, rather than deleting/adding new files).Info.plist
and Product Bundle Identifier
.Info.plist
, update it (it may have been updated automatically in Step 1).Product Bundle Identifier
, unless it is utilizing the ${PRODUCT_NAME} variable. In that case, search for "product" in the settings and update Product Name
. If Product Name
is based on ${TARGET_NAME}, click on the actual target item in the TARGETS list on the left of the settings pane and edit it, and all related settings will update immediately.Prefix Header
's path is also updated to the new name.""
) quotes if the path contains a space (
).To add to luke-west's excellent answer:
OLD.xcworkspace
to NEW.xcworkspace
.Podfile
from the project navigator. You should see a target
clause with the OLD name. Change it to NEW.OLD.podspec
file.rm -rf Pods/
pod install
.Build Phases
tab.Link Binary With Libraries
, look for libPods-OLD.a
and delete it.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With