Renaming Goals in Xcode 4

In Xcode 4, I changed the name of my cocoa application target name because I wanted to change the name of the executable. Build works fine, but after compiling Xcode, the old executable still runs, which is still listed in the Products folder in the project navigator.

How can I change which Xcode 4 application starts after build?

+42
xcode4
Mar 19 '11 at 13:14
source share
4 answers

To change the name of the application, you can select a new target, go to the "Assembly Options" tab, find the "Packaging" section and change the product name. You will notice that the entry in the Products group in the navigator changes.

Since Xcode automatically creates the appropriate schemas for each default target, you also need to make sure that the schema for your new target is configured to build and run a new target executable. To do this, select the layout from the popup, then select the editing layout from the same popup. Select the "Run" action in the schematic editor sheet and make sure that the "Executable file" pop-up is installed on a new, newly renamed executable file. Do the same for the Profile action so that it does the right thing when using the tools and all. It should be correctly selected, but sometimes Xcode gets confused when renaming / moving.

+75
Mar 19 '11 at 16:18
source share

If you want to change the project name, folder names, .xib files, etc., you can simply double-click your project name at the top of the Project Navigator and edit it. Bring it all over again! If you are under version control, such as SVN, first transfer your working copy! Xcode knows about SVN and GIT, and after changing the project name, there will be no confirmation before Xcode changes your working directory extensively. If you want to undo the change, you will have to undo the working copy, and you are likely to lose any other uncommitted changes.

On the other hand, if you do not want to rename anything other than an executable, this is the full procedure in Xcode 4.1. The only modified file is the .xcodeproj file, as you would expect:

  • Select "Clear" in the "Product" menu.
  • Choose Project Navigator from the View menu> Navigators (or click the icon in the upper left).
  • Click the triangle to see the files in your project, if necessary.
  • At the bottom of the list, click the triangle to open the Products folder.
  • You will see the name of the executable file; do not try to change it. Instead, click the Products folder to select it.
  • Press the delete key to delete the Products folder and your old executable file name.
  • Select the project at the top of the Navigator window.
  • Immediately to the right of the Navigator, in the "Targets" section, click and change the name of the executable file.
  • Go to the Summary tab and make sure the preference file ID is the one you want.
  • Go your way through each item in the Product-> Build For menu, creating all the goals.
  • Select "Product" - "Schema Management ...", select your schema and click the "Change ..." button.
  • Select "Run" on the left side of the dialog box and pull out the "Executable files" menu, select "Other ..." and select a new executable file.
  • Do the same for the profile to the left of the dialog box. Close the dialog box.
  • Close Xcode, and then restart it by opening your project.
  • You will see your new name at the bottom of the Navigator. Select it, right-click and select "New Group from Selection".
  • Click on a new group and rename it to "Products."

- Glenn Fawcett

+13
Oct 07 '11 at 19:53
source share

I answered in this thread: Change the name of the iPhone application in Xcode 4 An easy way to change the name of the product: change the target name. Hope this helps you.

+2
Sep 17 2018-11-11T00:
source share

In Xcode 4.5: right-click the icon for your project in the project navigator on the left side of the screen. Select Show Inspectors. On the right side of the screen, find the "Project Name" text box. Enter a new name and Xcode will ask for confirmation.

-one
Sep 14 '12 at 23:12
source share



All Articles