I am using Xcode 6.3.1 for developing an iOS game using cocos2dx 2.2.6. I need to change the name of my iOS application.
I used to do it by pressing return key after clicking the project in XCode. It would open a dialog box which confirms where you want to change the name in the project.
Two days ago I updated Xcode and now when I press enter to change the name of the project it opens the dialog box and suddenly crashes.
If any one can find me an alternate method to change the application name for my iOS project I would be grateful. Thanks
Updated: fixed step 4 to work properly with filenames containing spaces.
I've used shell commands to rename projects a few times, and it worked better than renaming from Xcode itself. Here are the steps (given we want to rename warnings_test
=> BestAppEver
) (you may need to install a few extra tools with brew install rename ack
):
Find all files with name containing the source string:
$ find . -name 'warnings_test*'
./warnings_test
./warnings_test.xcodeproj
./warnings_test.xcodeproj/xcshareddata/xcschemes/warnings_test.xcscheme
./warnings_testTests
./warnings_testTests/warnings_testTests.m
Rename those files and directories:
$ find . -name 'warnings_test*' -print0 | xargs -0 rename -S 'warnings_test' 'BestAppEver'
You'll need to run this command a couple of times, because directories will be renamed first, then files and directories inside those will be renamed on the next iteration. Check with the step 1 if all the files are renamed (should see empty output).
Find all occurrences of the string in all the files:
$ ack --literal 'warnings_test'
Look through the output to make sure all those string should be replaced. In most cases, they should.
Replace all occurrences:
$ ack --literal --files-with-matches 'warnings_test' --print0 | xargs -0 sed -i '' 's/warnings_test/BestAppEver/g'
One run is enough. To verify, run the command in step 3 again, you should see empty output.
Done! All your targets, schemes, files, mentions in comments, identifiers, names, etc. have been renamed. If you git add .
and git status
, you should see a lot of renamed:
entries (just another sanity check).
Don't change the project name. You should be able to without crashing, but the fact that you cannot do so does not matter. You don't need to change it, so don't. Leave the project name alone; it has nothing to do with anything the user ever sees. You want to change the name of the app, which is a completely different thing.
The name of the app, as shown below the icon on the device, is the CFBundleDisplayName
setting (Bundle Display Name) in the Info.plist. That's all you need to change (you might need to create it).
The name of the app that users will see in the App Store is different yet again; that is something you will set manually in your browser at iTunes Connect when you submit the app.
EDIT: Apple has just (secretly) released Xcode 6.3.2 GM seed, which is said to fix the crashing bug.
FURTHER EDIT: Xcode 6.3.2 final (not the GM seed) really does appear to fix this crashing bug.
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