I'd like to setup a macro in XCode 4 to checkout the current file from Perforce. How can I do this? I do not have perforce integrated with my project and do not wish to do so. This is pretty easy in Visual Studio but I don't know the XCode equivalent.
相关问题
- I want to trace logs using a Macro multi parameter
- Xcode debugger displays incorrect values for varia
- Image loads in simulator but not device?
- importing files from other directories in xcode
- XCode Server: Opening import file for module '
相关文章
- Macro expansion in elixir: how to define 2 macros
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Popover segue to static cell UITableView causes co
- “Storyboard.storyboard” could not be opened
- didBeginContact:(SKPhysicsContact *)contact not in
- Perforce fast sync a directory to a clean state
Just came across this at Perforce.com as their means of making this work. I tried it, and it's pretty good.
http://answers.perforce.com/articles/KB/2997
As per the comment, it works in Xcode 5 as well.
And now it's tested and working in Xcode 6!
EDIT: If that doesn't work, and you're using OS X Mavericks, this guy fixed the script to keep working. Just make sure the script references p4 properly. I had to change it from
/usr/local/bin/p4
to/usr/bin/p4
.http://forums.perforce.com/index.php?/topic/2830-xcode-501-x-mavericks-perforce-integration-not-working/#entry11319
xcodeunlock.sh
Once this is set up correctly, unlocking a file in Xcode should run this script and attempt to checkout the file. Unfortunately any output goes to '/var/log/system.log'. I'm not sure how to notify Xcode 4 of a failure in this script.
It's maddening trying to get XCode to work with Perforce. Here is a solution I came up with that is:
One-time setup as follows:
/usr/bin
(or whatever) and do a chmod +x on it. For official setup notes, and if you need to do any custom environmental variable tricks, please see this tech note.Once you've done this, let's say you are in XCode and you are viewing a source code file that you want to check out. Here's the rigamarole:
Shift Command Enter
to get a DTerm windowp4 edit
and then hitShift Command V
to paste in the filename of the active file, and hit returnI haven't set this up in a while, so please let me know if you run into any glitches and I'll update my info here to make it as painless as possible. But otherwise, this is the best solution I've found.
The nearest I can think of is a service, so it looks like Xcode 4 Perforce Services could do the job. I haven't tried it personally, though. I stumbled across it in this question.