Renaming targets in Xcode 4

前端 未结 4 1701
情书的邮戳
情书的邮戳 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:42

    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.

    0 讨论(0)
  • 2021-01-30 05:54

    In Xcode 4.5: right click on your project icon in the project navigator on the far left side of the screen. Select "Show Inspector". On the far right side of the screen locate the Project Name text field. Enter a new name and Xcode will ask for confirmation.

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2021-01-30 06:04

    I answered in this topic: Change name of iPhone app in Xcode 4 Simple way to change product name : change target name. Hope this help you.

    0 讨论(0)
提交回复
热议问题