43

I want to change this:

//
//  ViewController.h
//  MyApp
//
//  Created by _username on 12-04-05.
//  Copyright _company_name. All rights reserved.
//

And I tried: http://macdevelopertips.com/xcode/change-company-name-in-xcode.html and it didn't work.

I also tried this: http://iosdevelopertips.com/xcode/change-company-name-from-within-xcode-on-a-per-project-basis.html but it did not exist in Xcode 4.

I'm using Xcode 4.2

shim
  • 9,289
  • 12
  • 69
  • 108
Jakub
  • 13,712
  • 17
  • 82
  • 139

4 Answers4

50

go to System preferences -> users and groups -> click on your username

On that page there should be a button saying Open... click that and change that record in your contacts. When you create a new class it should get the information from that record!

Manuel
  • 10,153
  • 5
  • 41
  • 60
  • Weird as this may sound, the only entry in my contacts is my gmail which I signed in on messages. Xcode takes the username of the local account. Any other workaround ? – nsuinteger Aug 22 '13 at 03:07
  • The local account's username should be shown in the contact list as a contact. This is the entry you need to change. – Manuel Aug 26 '13 at 09:51
  • 4
    This is not working for me on Xcode 6, the template now looks like // // ___FILENAME___ // ___PROJECTNAME___ // // Created by ___FULLUSERNAME___ on ___DATE___. //___COPYRIGHT___ // – tecknut Oct 29 '14 at 09:37
  • This question was for XCode4.2, ask a new question if you can't find the answer yourself. – Manuel Oct 29 '14 at 15:24
  • 1
    Try this one, it works on my case: http://rshankar.com/how-to-set-organization-name-for-xcode-project/ – mamaz Apr 22 '16 at 12:24
  • As a matter of privacy, I believe this answer is suboptimal. – William Entriken Feb 18 '17 at 18:45
  • This was not working for me. It seems to only use the user's "Full Name" in advanced options (see [this response](https://stackoverflow.com/a/27074406/1032372)) – shim Aug 11 '17 at 15:44
41

For changing author name in Xcode 6, just go to User & Groups in system preferences, right click current user (make sure permission is unlocked), select Advanced Options, change the "Full name" section.

shim
  • 9,289
  • 12
  • 69
  • 108
coolbeet
  • 1,645
  • 1
  • 18
  • 20
20

For the User Name:

Open up the address book and go to your user account, and edit your name (the large, bold line at the top). (Address Book is by default the first app in your Applications folder.)

If you don't know which contact is your user account: Open up System Preferences. Go to Users & Groups (in the System row); your user account should already be selected. Click on the "Open..." button for the Address Book Card.

Changing your name in the Address Book won't change any already-created files; it will only affect new files that you create.

For the Company Name:

In Xcode 4, open up your project. Select the top-most item in the Project Navigator (MyProjectName, 1 target, iOS SDK 4.3 -- or whatever). Open up the file inspector (View->Utilities). In the Project Document section, you should see an "Organization" line. Edit that, and new files that you create will display the new organization name. This is a project setting, hence you'll have to do it for every project.

For new projects that you create, the Organization Name will be whatever the value was on the previously open project. (You can edit it when creating the new project.)

shim
  • 9,289
  • 12
  • 69
  • 108
AndrewS
  • 8,196
  • 5
  • 39
  • 53
  • 1
    This answer is worthless. I don't have any app called Address Book, and I don't see any Organization in the project settings. – John Henckel May 02 '14 at 16:43
  • 4
    Two years ago, the app was called Address Book. It's now called Contacts. The "Open..." button I mentioned still takes you to the right place. I have no idea why you're talking about "project settings"; the Organization line (as of 5.1.1) is still where I describe it in the answer. – AndrewS May 06 '14 at 18:56
  • Just to clarify, the file inspector is the right side bar (no new window will show up if you already have it open). Also, this worked perfectly. – Leonard Pauli May 14 '15 at 13:27
11

I know this question is quite old, but I have found a way to customize the template without changing the Full name. It basically consists on creating a custom plist file named IDETemplateMacros.plist, creating a new key named FILEHEADER under Root and putting the header text as the value. Then, you need to copy this header to one of the following locations:

  • Project user data: <ProjectName>.xcodeproj/xcuserdata/[username].xcuserdatad/

  • Project shared data: <ProjectName>.xcodeproj/xcshareddata/IDETemplateMacros.plist

  • Workspace user data: <WorkspaceName>.xcworkspace/xcuserdata/[username].xcuserdatad/

  • Workspace shared data: <WorkspaceName>.xcworkspace/xcshareddata/

  • User Xcode data: `~/Library/Developer/Xcode/UserData/``

I've tried copying it to my User Xcode data folder

More information can be found here

A full list of available macros can be found here or looking at the Xcode help

Cris
  • 774
  • 9
  • 32