Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Xcode and Perforce

Has anyone been able to setup XCode to work with a Perforce SCM server? I know that this is supported and can be done, but I have not been able to integrate Perforce into XCode's SCM features. I have installed the P4 command line app and it says that it has authenticated properly. However, when it attempts to list the contents of the repository, the log reads:

Xcode[18884:203] * NSTask: Task create for path '/usr/bin' failed: 13, "Permission denied". Terminating temporary process.

The repository never shows any files.

Any ideas?

MacBook, Mac OS X (10.5.4)

Posted on Sep 9, 2008 10:24 AM

Reply
Question marked as Best reply

Posted on Sep 9, 2008 12:10 PM

Yes, I'm using Perforce with XCode. Currently it's just a local installation (which I back up remotely) since I'm the only developer 🙂

The configuration work I did by hand was:
- Copied p4 to /usr/bin (made sure it was chmod +x, etc.)
- Created a .p4config file with P4PORT=localhost:9090 in a directory above my XCode enlistment
- Did 'p4 client' to set up the directory mappings I wanted

After that was done, I just use XCode on projects within that subdirectory structure, and it handles figuring out what to do fine. Well, except that I still haven't figured out how to get it to store the actual "project files" in SCM for me, but I'm primarily using it for code diffs and rollback anyway.
3 replies
Question marked as Best reply

Sep 9, 2008 12:10 PM in response to cjbarrett

Yes, I'm using Perforce with XCode. Currently it's just a local installation (which I back up remotely) since I'm the only developer 🙂

The configuration work I did by hand was:
- Copied p4 to /usr/bin (made sure it was chmod +x, etc.)
- Created a .p4config file with P4PORT=localhost:9090 in a directory above my XCode enlistment
- Did 'p4 client' to set up the directory mappings I wanted

After that was done, I just use XCode on projects within that subdirectory structure, and it handles figuring out what to do fine. Well, except that I still haven't figured out how to get it to store the actual "project files" in SCM for me, but I'm primarily using it for code diffs and rollback anyway.

Nov 24, 2008 1:29 AM in response to cjbarrett

To continue the XCode/Perforce integration discussion a little further.

Once they have basic XCode/Perforce integration working has anyone been able to get their project file automatically checking out.

Here is the use case we are having problems with:
1. Your project including all source, project file and resources is version controlled in Perforce
2. You can successfully go to edit a file such as main.m and be prompted to "SCM Edit" the file. Choosing to "SCM Edit" sucesfully checks out the file in perforce.
3. Double clicking on the project file allows you to edit the file BUT you notice it NEVER gets checked out in Perforce. Further when you go to exit XCode it asks if you if you want to "Close and Lose" changes you have made to the project file.

As everyone is aware the project file needs editing quite often. Not having the IDE check it out on your behalf becomes annoying quite quickly.

I have watched the SCM actions reported by XCode closely (apple-shift-v) and the commands that are being executed by XCode seem pretty right. My guess is that xcode isn't interpreting the result of the following command correctly:
p4 opened <base>/projects/myworkspace/main/TestProject.xcodeproj/...


I notice with interest in the "Source Code Management" section here http://developer.apple.com/releasenotes/DeveloperTools/RN-Xcode/index.html that Apple have recently been doing quite a bit of work with Xcode/Perforce integration.

Having project files broken in SCM integration seems obvious. Surely I must be missing something?

Any thoughts/fixes/comments/suggestions or updates very welcome 🙂

Thanks for your time,
Xumii Dev Team

Xcode and Perforce

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.