开发者

Where do I set my company name?

开发者 https://www.devze.com 2023-01-02 03:49 出处:网络
When creating new source files xcode adds comments with your name and comp开发者_开发技巧any name.

When creating new source files xcode adds comments with your name and comp开发者_开发技巧any name.

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


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).


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).


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

Where do I set my company name?


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.

Where do I set my company name?

Then you can try by creating any new Xcode project:

Where do I set my company name?


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)


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


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.


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

Where do I set my company name?

:


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.


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.


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.


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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消