Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 how to rename copied target

Tags:

xcode

ios

xcode6

I know that this is not a new question, but I have tried many solution like edit Xcode project file manually or recreating new scheme for target after renaming it.

Can somebody help me with this question how copy target in right way and then rename it.

Right now I just rename scheme and it is displayed as is. But when Xcode is running app, under progress indicator it says: Running ProjectName-copy. But I have renamed target but seems product names or some build settings still has "...-copy" in the name.

like image 976
Matrosov Oleksandr Avatar asked Dec 03 '14 23:12

Matrosov Oleksandr


People also ask

How do I rename a target in Xcode?

Select your target from TARGETS(in left navigation bar) and double click, then rename it.

How do I rename an Xcode project without losing my mind?

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.

How do I duplicate targets in Xcode?

Go to project's settings in the Project Navigator panel. Under the Targets sections, right click the existing target and select Duplicate to copy your existing target.

Can you rename files in Xcode?

Right-click on the class name in the interface ( . h ) file, choose Refactor->Rename , and Xcode will guide you through the process, allowing you to preview changes before you commit to them. Xcode will let you review the changes before you commit.


2 Answers

  1. Duplicate a target.
  2. Double click the copy of target and change its name to whatever you want.
  3. 'New target -> Build Settings -> Packaging -> Product Name', change it to the name you want.
  4. Product (Menu item) > Schemes > Manage Schemes, then click the '+' button, select the new target and click 'OK' button.

All done.

PS:
After Duplicating the target, Xcode make a new Info.plist file named 'xxx copy-Info.plist' in the root path of project. If you want to change its name and path, after doing this, you should go to 'New target -> Build Settings -> Packaging -> Info.plist file' and change the value to the path of new file.

like image 51
webfrogs Avatar answered Oct 10 '22 23:10

webfrogs


Press on the target name in xcode ( in the same place where you want to select the sim/device type) and select "Manage Schemes...". Highlight the scheme with the copy inside name and press enter on keyboard. You can rename it there.

like image 42
Tomasz Dubik Avatar answered Oct 10 '22 23:10

Tomasz Dubik