On May 15, 2007, at 2:01 PM, Todd Heberlein wrote:
What I have tried: (1) In the "Groups & Files" list, I selected the appropriate target and selected "change name" Action. The Problem: When I execute the program, however, the name displayed is still the old name (based on the project name).
(2) In the "Groups & Files" list, I selected the target and selected "Get Info" Action. Under the "Properties" tab, I changed the Executable: field from ${EXECUTABLE} to new name. The Problem: When I select Build and Go, the main window pops up, but the application does not show up in the dock, and the menus for the application don't show up. When I try to start the application from the Finder, I get an error message saying the application is broken.
(3) In the "Groups and Files" list, I selected the appropriate Executables item (which has the same name as the Target's name) and selected the "Get Info" action. Under the "General" tab is the "Executable path" field which holds the original name (the name of the project), but the field is not editable. The "Choose" button for the Executable path is also grayed out and inactive.
1) does nothing. There's no necessary association between the name of a target and the name of its build product. Most project templates set them to the same thing when the project is created, and you can create a durable linkage between the two, but that's not typical behavior.
2) is necessary but not sufficient. Yes, the executable in the Info.plist has to match the executable's name in the bundle. And you're changing one of the two here.
3) is unproductive. You're changing the name of the reference in the project to the build product, but that's unfortunately not what Xcode uses when creating it; it's like you're changing the name of an alias in order to change the original.
What you need to do is
(4) In Groups and Files, select the Target and choose Get Info. Click the Build tab, select All Configurations, and type "name" into the search field. You'll see "Product Name" as a build setting. Set that field to the name you want. If you like, you can set it to $(TARGET_NAME), and also set the Executable field in (2) the same way. If you do both of those, in the future step (1) will do everything at once.
Chris
|