How does Xcode know who the project was "created by"?

James Raitsev picture James Raitsev · Aug 5, 2011 · Viewed 15.1k times · Source

Whenever a new file is added to the project, Xcode adds the following lines of comments on top.

//  Created by {my name here} on 8/4/11.
//  Copyright 2011 __{my company name here}__. All rights reserved.

How does it know what my name is? Does it assume that if my account name belongs to "Mike", "Mike" is the name of the developer writing this code?

Does it then look at Address Book trying to find out what company "Mike" works at? It would make sense, however company listed as part of my address book is not what shows up in the Xcode file.

Can one set the following up in some place where Xcode will read it from?

  • Name
  • Company name
  • some other text describing something important

Answer

Filip Radelic picture Filip Radelic · Aug 8, 2011

In Address Book select yourself (or add yourself if you aren't there) and then go to Card -> Make This My Card in menu bar. The name, last name and company name from that card will be used to populate info in file headers when creating files from Xcode templates.

Alternatively, you could set it using defaults via Terminal.app like this:

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