127

When creating new source files xcode adds comments with your name and company name.

Where do I set my company name for xcode (not the project).

2

14 Answers 14

93

in Xcode 4 GM seed:

in the navigation pane (far left side), select the project (top item).

Expand the Utilities pane (at window top-right, far right button in the 3-button "View" group).

In the "Project Document" section is the "Organization" text field (File Inspection view, second section from top).

3
  • 2
    Be sure to save the project properly after completing this step. See Sergio's answer on how to do this: stackoverflow.com/questions/2956464/… Jul 24, 2011 at 14:03
  • I found it. Then I change something related to relative to absolute, etc. Well, now things doesn't show up
    – user4951
    May 8, 2012 at 10:42
  • @JimThio I think it might only save onblur or something stupid, you may need to tab out, tab back in, save a few times, and wave a rubber chicken over the monitor
    – slf
    May 8, 2012 at 13:51
75

By default, Xcode inserts a company name something similar to the following in all new source files (.m .h etc):

Copyright (c) 2009 MyCompanyName. All rights reserved.

Changing this reference is as simple as entering the following from within a terminal window, replacing “YourNameHere” with the text you prefer. Also, make sure this is all entered on one line in the terminal.

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="YourNameHere";}'

OR

you could even go to ~/Library/Preferences and double-click com.apple.Xcode.plist and use the handy-dandy plist editor to set this and a whole bunch of other interesting defaults not covered by the Xcode or IB preference panels.

OR

@slf answer on this question shows an improved way to achieve this in Xcode 4 (Pasted below)

in the navigation pane (far left side), select the project (top item).

Expand the Utilities pane (at window top-right, far right button in the 3-button "View" group).

In the "Project Document" section is the "Organization" text field (File Inspection view, second section from top).

1
  • 2
    OR setup the default (me) contact on your Mac's addressbook (that's where XCode looks for your name/company) [sorry just saw the answers below :P]
    – Alladinian
    Apr 12, 2012 at 12:29
55

In Xcode 7.3 (edit: till 13.3.1) just select top project file and Look in Utilities on Left pane

xCode

28

I have tested on the Xcode 4.2 Beta 7 (iOS 5.0).

It seems like the Xcode does not retrieve ORGANIZATIONNAME from neither

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions
'{ORGANIZATIONNAME="YourNameHere";}'

nor

~/Library/Preferences/com.apple.Xcode.plist

The proper solution is to update your name & company name in Address Book.

enter image description here

Then you can try by creating any new Xcode project:

enter image description here

5
  • +1 Same here, the terminal lines doesn't seem to work neither!
    – Andy M
    Mar 31, 2012 at 8:45
  • 3
    Maybe this works when you create a new project, but if you have an existing project and create a new file, it does not work
    – JeffB6688
    Apr 13, 2012 at 18:11
  • this shld be the accepted answer...neat and simple..Thanks mate :)
    – Lithu T.V
    Aug 2, 2012 at 10:33
  • Thanks for this - wasn't exactly intuitive on Apple's behalf. Does anyone know if com.apple.Xcode.plist ORGANIZATIONAME key gets used anywhere?
    – Pete855217
    Nov 8, 2012 at 7:25
  • The Address Book app is now called Contacts.
    – Pang
    Mar 9, 2015 at 7:24
11

Or you can set the company name in your address card in the Mac OS X address book application. Worked for me (SL, Xcode 3.2.2)

3
  • I just confirmed that setting your company name in Address Book works for the public release of XCode 4.
    – Daniel
    Mar 10, 2011 at 5:06
  • This setting takes precedent over ORGANIZATIONNAME, my projects wouldn't change until I set this properly. Jul 24, 2011 at 14:04
  • 1
    However, it is slightly problematic if you are a contractor… Sep 29, 2011 at 16:17
11

Adding to what SLF wrote above:

in Xcode 4 GM seed:

in the navigation pane (far left side), select the project (top item).

Expand the Utilities pane (at window top-right, far right button in the 3-button "View" group).

In the "Project Document" section is the "Organization" text field (File Inspection view, second section from top).

But there is a small catch:

Changing the Organization name as SLF described didn't set the project file as modified and no changes where saved.

You need to make a small change to the project, like adding a group after you change the organization name, this will cause Xcode 4 to save the file.

Also if you are working on a workspace, you need to make the change for each project.

Tested at XCode 4.0.2

1
  • cool :) I've found pressing enter/return a lot will get it to stick as well
    – slf
    Jul 24, 2011 at 15:31
7

If you want change __MyCompanyName__ in Xcode 4, you can try the following command.

defaults write com.apple.dt.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME="YourNameHere";}'

Carefully, this writes in the domain, com.apple.dt.Xcode, not com.apple.Xcode

I only test on Xcode 4 pre3 and it works.

0
6

Simply just go to appName-Info.plist and add a field "Copyright(human-readable)" : nameOfDeveloper or companyName. enter image description here:

1
  • This is project specific which is why I find it a favorable answer.
    – csga5000
    Jan 30, 2016 at 7:25
4

In XCode 5 you can select company name on project creation. If you would like to change company name for existing project, then:

  1. Open .xcodeproj in Finder by selection "Show package contents"
  2. Open project.pbxproj in TextEdit
  3. Replace current value of ORGANIZATIONNAME with desired one.
2

There's more confusion about this than there should be. I clarified here: https://stackoverflow.com/a/9793899/1273966 I'll do the same in this thread.

If the organisation name is blank in the project document (described above) the company name is pulled from the 'me' entry in your address book.

If you enter an organisation name in the project document as described above, it will override the company name in the address book. IE: You can override your company name on a per project basis. Pretty clever, but obviously has a lot of people confused.

2

open up the xcode

Expand the Utilities pane (at window top-right, far right button in the 3-button "View" group).

In the "Project Document" section is the "Organization" text field (File Inspection view, second section from top).

there you can set the name.

0
1

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.

The Organization Name field is one that's shown in the New Project wizard. Its default value is the value that it was on the previously open project.

0

It looks like the final version of Xcode 4 is not respecting the ORGANIZATIONNAME setting (either the old one, or the new one with com.apple.dt.Xcode. This sucks for me, because I have my company name in my address card, but I'm not doing Xcode work for my company. Thus, I don't want my actual company name to get inserted in my source files. I want the value I set for ORGANIZATIONNAME.

Update: It looks like it partially works. I had shutdown Xcode before setting the value, then I restarted it, and created a new project. I saw that it was still using my company name from my Address Book card, and not ORGANIZATIONNAME. But then I created some new files in the project (File>New File...) and when they were created, they DID have the value from ORGANIZATIONAME. So, it looks like the code there is at least two bits of code that fill in the file template with the company name, and they are pulling from different locations.

0

You can try remove app-info.plist and try to input app-info.plist in your project.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.