In Xcode 4 I changed the name of my cocoa Application's Target Name because I wanted to change the name of the executable. The Build works fine but after compiling Xcode still starts the old executable that is still listed in the Products folder in the project navigator.
How can I change which application Xcode 4 starts up after build?
Select the project you want to rename in the “Project Navigator” which can be found on the left side of the Xcode view. On the right-hand side of the window, select the “File Inspector”. The name of your project should be in there under “Identity and Type”, change it to “NEW” and press Enter.
Click on the project you want to rename in the "Project navigator" in the left panel of the Xcode window. In the right panel, select the "File inspector", and the name of your project should be found under "Identity and Type". Change it to your new name.
And now in Swift, you may call AppTargetName() and get your target name, without need to modify Info.
To change the name of the application, you can select the new target, click the Build Settings tab, look for the Packaging section and change the Product Name. You'll notice the entry in the Products group in the navigator changes.
Since Xcode automatically creates matching schemes for each target by default, you'll also need to make sure the scheme for your new target is set to build and launch the new target's matching executable. To do this, select the scheme from the popup then choose edit scheme from the same popup. Select the Run action in the scheme editor sheet and make sure the Executable popup is set to your new target's newly-renamed executable. Do the same for the Profile action so it does the right thing when using Instruments and all. It should be properly selected already, but sometimes Xcode gets confused when renaming/moving things around.
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