Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid modifying the project file ( .xcodeproj ) of Xcode frequently worked on by team?

Unlike Eclipse or other IDEs, Xcode will modify the .xcodeproj file anytime it finds that a file or group in the project is added, renamed or removed. This is very inconvenient when there is more than one developer working on the project.

Once my SCM tools complain of conflicts on the .xcodeproj file, all I can do is check out another copy of the entire project and merge all changes I made into it and praying that no one is 'faster' than I.

Is there a workaround to change the default strategy of Xcode?

like image 920
Evan Wu Avatar asked Apr 19 '12 03:04

Evan Wu


People also ask

How do I move an Xcode project to another folder?

1. Click each group, then click the square icon (see screenshot below) and choose the folder your project file is in. "None" will show up when you choose the same folder your .

What is project navigator in Xcode?

The Project navigator displays your project's files and lets you open, add, delete, and rearrange those files. To open the Project navigator, at the top of your project window's navigator area, click the icon that resembles a file folder.

How to Push Xcode project to github?

Push your projectGo to Source Control in Xcode and select Projectname -- master, then Configure... In the Address field, paste the Git clone URL for your repo copied in the previous step. Select Add Remote, then select Done to finish creating the origin remote for your local Git repo.

How do I add an existing project to Xcode workspace?

In the Project navigator, Control-click in the empty space and choose Add Files to “workspaceName”. In the sheet that appears, select an Xcode project (a file with a . xcodeproj filename extension). Click Add to add the project to the workspace.


2 Answers

Unlike Eclipse or other IDEs, Xcode will modify the .xcodeproj file anytime it finds that a file or group in the project is added, renamed or removed.

Unlike Eclipse and some other IDEs, Xcode maintains the list of what files are in the project and the group structure as part of the project "file" (the .xcodeproj file is really a directory). The groups don't have to physically exist as directories and the files can actually be in all sorts of places and don't have to be named as they appear in Xcode.

If somebody adds a new file to a project, or removes a file from the project, or changes the name of a file or group, this needs to be reflected in your SCM because somebody else checking out a working copy or cloning the your repository or whatever tends to like it better if the project is in sync with what's on the disk. So for example, if somebody removes a file but that change is not reflected in the Xcode project file of others, they will get compilation errors after they update/sync/pull or whatever.

Having said that, the project file also contains a load of user settings that are not important. In Xcode 4.x I set the following directories to be ignored by my SCM:

foo.xcodeproj/project.xcworkspace/xcuserdata
foo.xcodeproj/xcuserdata

In earlier version project files I used to set the following to be ignored:

foo.xcodeproj/*.pbxuser
foo.xcodeproj/*.mode1v3

That seems to filter out unnecessary nonsense as far as SCM is concerned.

like image 59
JeremyP Avatar answered Oct 13 '22 18:10

JeremyP


From what I understand, the .xcodeproj is actually a wrapper for several files, including the .pbxuser and .pbxproj. Don't know what SCM you are using, but this topic was touched on here for those using git, and the consensus seems to be that the .pbxuser file as well as many others shouldn't be included under version control.

like image 1
tronbabylove Avatar answered Oct 13 '22 18:10

tronbabylove