XCode 6.3.1 crashes while renaming project
Asked Answered
N

2

5

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

Neoprene answered 23/4, 2015 at 13:20 Comment(6)
Out of curiosity I just tried renaming a new project in latest Xcode, using the file inspector, and Xcode says gathering information and then crashed! Possible bug I think.Subgenus
Yeah, same. If you know which version was working correctly you might use it for now on a separate (or virtual) machine, the only alternative I can see is to do all the work manually: you'll need to rename a few files and directories as well as modify the content of the project text-files, if you have two versions of the projects with minimum required changes any graphical source control tool would help a lot to inspect the differences. Also might want to submit a bug report and leave a reference here.Gannes
If anybody can figure out the manual changes that need to be made in order to change the application name kindly guide me.Neoprene
"I need to change the name of my iOS application." Then why are you changing the project name? They have nothing to do with each other! Leave the project name alone.Sizzle
Xcode 6.3.2 fixes this, according to the release notes.Magdaleno
possible duplicate of Xcode 6.3 is crashing on Project RenameReede
S
9

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.

Sizzle answered 23/4, 2015 at 17:40 Comment(4)
Thanks man. This was really helpful. It's exactly what I needed to do.Neoprene
I upvoted but "Don't change the project name" isn't a thoughtful suggestion. It's not just about what user sees, but then again Xcode, Macos and their bugs...Gunas
@Gunas don't change the project name just in order to change the app name. That is very good advice. Don't change the project name until this crashing bug is fixed. That is good advice too. Now, if you foolishly put a comma in the project name, that advice doesn't apply to you...Sizzle
Matt's answer saved me tons and tons of headache. See Linh Nguyen answer on how to best change the display name: #19594731Elenaelenchus
C
11

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):

  1. 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
    
  2. 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).

  3. 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.

  4. 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).

Cryptology answered 23/4, 2015 at 17:13 Comment(4)
Thanks but I just needed to change the name and that turned out to be pretty easy. Thanks anywaysNeoprene
@Cryptology step 4 I receive the following error : "sed: Completely: No such file or directory". Any idea why?Strategy
@luca, thanks for your comment! Apparently, you're trying to rename a project containing spaces to another name containing spaces (meh!), but anyway I fixed the step 4, so it should work now.Cryptology
@Cryptology Step 2, when using Cocoapods, some of the files/directories will have the name prepended with 'Pods-'. This means that you will have to search for the pattern '*warnings_test*' instead of 'warnings_test*'Laurence
S
9

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.

Sizzle answered 23/4, 2015 at 17:40 Comment(4)
Thanks man. This was really helpful. It's exactly what I needed to do.Neoprene
I upvoted but "Don't change the project name" isn't a thoughtful suggestion. It's not just about what user sees, but then again Xcode, Macos and their bugs...Gunas
@Gunas don't change the project name just in order to change the app name. That is very good advice. Don't change the project name until this crashing bug is fixed. That is good advice too. Now, if you foolishly put a comma in the project name, that advice doesn't apply to you...Sizzle
Matt's answer saved me tons and tons of headache. See Linh Nguyen answer on how to best change the display name: #19594731Elenaelenchus

© 2022 - 2024 — McMap. All rights reserved.