Renaming targets in Xcode 4

前端 未结 4 1703
情书的邮戳
情书的邮戳 2021-01-30 05:21

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 Xco

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 05:55

    If you want to change the project name, folder names, .xib files, etc., you can just click twice on the name of your project at the top of the Project Navigator and edit it. Back everything up first! If you are under version control, such as SVN, commit your working copy first! Xcode knows about SVN and GIT and once you change the project name, there will be no confirmation before Xcode extensively modifies your working directory. If you want to undo the change, you’ll have to revert the working copy and you’re likely to lose any other uncommitted changes.

    On the other hand, if you don’t want to rename anything except the executable, here’s the full procedure in Xcode 4.1. The only file modified is the .xcodeproj file, as you would expect:

    1. Select Clean from the Product menu.
    2. Select Project Navigator under View->Navigators (or click the icon at top left).
    3. Click the triangle to see the files in your project, if necessary.
    4. At the bottom of the list, click the triangle to disclose the Products folder.
    5. You'll see the name of your executable; do not try to change it. Instead, click the Products folder to select it.
    6. Hit the delete key to delete the Products folder and your old executable name.
    7. Select your project at the top of the Navigator view.
    8. Immediately to the right of the Navigator, under Targets, click and change the name of the executable.
    9. Click the Summary tab and check that the preference file Identifier is the one you want.
    10. Work your way through every item under the Product->Build For menu, building all targets.
    11. Select Product->Manage Schemes..., select your scheme, and press the Edit... button.
    12. Select Run at the left of the dialog and pull down the Executable menu, select Other... and choose your new executable.
    13. Do the same for Profile at the left of the dialog. Close the dialog.
    14. Quit Xcode and then restart it by opening your project.
    15. You'll see your new name at the bottom of the Navigator. Select it, right click, and choose "New Group from Selection".
    16. Click on the new group and rename it "Products".

    -- Glenn Fawcett

提交回复
热议问题