본문 바로가기
모바일개발(Mobile Dev)/IOS개발(ObjectC)

Rename a Project in Xcode

by 테크한스 2015. 12. 6.
반응형

written by http://matthewfecher.com/app-developement/xcode-tips-the-best-way-to-change-a-project-name-in-xcode/




iOS Dev Tip: The Best Way to Rename a Project in Xcode

 By Matthew Fecher, August 2013

Xcode Rename

If you’re coming from another developing environment, you maybe surprised to see that Xcode has no “Save As” menu option.   So then, what’s the preferred way to rename your project and dependent files?

The best way to change the project name in Xcode:

1) Double click slowly on the project name in the project navigator pane in the upper left hand portion of the screen (see screenshot above).  In this example, I am changing the project name from “iPhone Piano” to “iPhone ElectricPiano.”

Xcode rename step 2

figure 2

2) After you have entered a new name, Xcode will give you the option of updating the other supporting files (see Figure 2).  Click “Rename” to continue.

We’re almost done!

Now that the file names have changed, you will need to update the scheme and bundle identifier.

To update the scheme:

1) Click on the “Set Active Scheme” button for the project and choose “Manage Schemes” from the drop-down menu (see Figure 3).

Xcode Rename Step 3

figure 3

2) Double click slowly on the scheme you would like to edit, change the name and press return.

Viola! Your project is updated.

Xcode Rename part 4

Happy coding!



HOW TO RENAME A PROJECT IN XCODE

You are working on a project from sometime and now you decided to change its name. Earlier there was a dedicated menu item for the same. But it’s no more available in the new version of XCode. To rename the project follow the steps below –

● Click twice slowly on the project root in the project navigator and it then becomes editable. After you rename the project and press ‘enter’ it will suggest to automatically change all project-name-related entries and will allow you to de-select some of them if you want.

The two clicks should have sufficient time interval otherwise it will open up the project settings page in a new window. Or you can click on project name and press the return key, it’ll also make the project name editable.

● In addition to renaming the project, you may want rename the scheme so that it matches your new project name.

To change the name of your scheme:

Product ==> Manage Schemes…

Then select your scheme and hit return/enter to edit the name




HOW TO RENAME XCODE PROJECT SOURCE FOLDER

I have previously wrote about how to rename a project in XCode. But this time we’ll talk about how to rename the source folder of any project. Renaming the project in XCode only rename within XCode, but it does not rename the folder in the filesystem.

Note: Before doing any changes do backup your project folder. This is seriously recommended.

Follow the steps below to rename the source folder of your project –

  1. Close XCode.
  2. Rename the source folder.
  3. Right click the project bundle .xcodeproj file and select “Show Package Contents” from the context menu. Open the .pbxproj file with any text editor.
  4. Search and replace any occurrence of the original folder name with the new folder name.
  5. Save the file.
  6. Open XCode project.


I was renaming my app from "App's Name?" to "Apps Name", removing the question mark and apostrophe, to prevent the error "A signed resource has already been added, modified, or deleted". However, at one point, the project seemed to clean itself and try building/running at the same time, which caused the build to fail. So I closed and reopened Xcode, and the project is now broken. I can't save it, or build or clean it (all these options are greyed out in the menu). It shows a wheel next to my project and says my device is ineligible, whilst not allowing me to switch to any simulators.

I addition, when I try changing the app name in the File Inspector, and hit enter, the following popup appears:

http://i.imgur.com/vfLMzlG.png

Does anyone know how to fix this?

EDIT: So I think I've found out it's to do with the Schemes messing up. Here's a screenshot of my Schemes:

http://i.imgur.com/4uOMg9d.png

So, is there any way to remove the other 2 schemes, leaving just the one in the middle? This may fix my issue.

EDIT 2: So I've solved the issue by going into "Edit Schemes", and changing the executable in the "Run" section to be the same as the scheme I wanted to use, rather than being "Ask on launch". Hope this helps someone in the future!

shareimprove this question
   
are you using Time Machine (built into MacOS)? – Michael Dautermann Oct 4 '14 at 10:22
   
I haven't knowingly used it before, why? I have only had my mac for 2-3 weeks. EDIT: I just checked and Time Machine is off :\ – Isaac A Oct 4 '14 at 10:25 
   
Please add your EDIT 2 as an answer to your own question. Them mark it as the accepted answer. – Andy Ibanez Oct 12 '14 at 21:40

So I've solved the issue by going into "Edit Schemes", and changing the executable in the "Run" section to be the same as the scheme I wanted to use, rather than being "Ask on launch". Hope this helps someone in the future!

shareimprove this answer
   
Just renaiming the bundle displayName works . In xcode 6 app name is accociated with module name so when you change the name it conflicts with schemes. Its safe to just change the BundleDisplay name in info.plist if you wish to change the app display name only – Muhammad Mar 10 at 7:40


반응형

'모바일개발(Mobile Dev) > IOS개발(ObjectC)' 카테고리의 다른 글

english locale for the displayName  (0) 2015.12.10
Facebook Login in iOS App  (0) 2015.12.06
Implementing Pull-to-Refresh in xcode  (0) 2015.11.30
Customizing Navigation Bar  (0) 2015.11.29
IOS image file path  (0) 2015.11.28