
Setting up Subversion 1.5 on Xcode
Up until the release of the iPhone SDK for iPhone OS 2.2, Xcode 3.0 did not work with installations of Subversion 1.5+, but the latest build solves this. Alas, setting up Subversion to work with Xcode requires some extra work. To save you some precious time googling around, I have prepared a brief tutorial to guide you through the process:
Step 1. Download and install the latest iPhone SDK for iPhone OS 2.2 from the iPhone Dev Center. This includes Xcode 3.1.2.
http://developer.apple.com/iphone/
Step 2. Download and install the latest Subversion binaries for Mac OS X from CollabNET
http://www.collab.net/downloads/community/
Step 3. Copy and paste the following code into a text file (e.g. “enable-svn.sh”). You can do so with TextEdit.app, but remember to convert the document to plain text before saving it (Format/Make Plain Text).
ln -s -f /opt/subversion/lib/libapr-1.dylib /usr/lib/libapr-1.dylib ln -s -f /opt/subversion/lib/libapr-1.dylib /usr/lib/libapr-1.0.dylib ln -s -f /opt/subversion/lib/libaprutil-1.dylib /usr/lib/libaprutil-1.dylib ln -s -f /opt/subversion/lib/libaprutil-1.dylib /usr/lib/libaprutil-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_client-1.dylib /usr/lib/libsvn_client-1.dylib ln -s -f /opt/subversion/lib/libsvn_client-1.dylib /usr/lib/libsvn_client-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.dylib ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_fs_fs-1.dylib /usr/lib/libsvn_fs_fs-1.dylib ln -s -f /opt/subversion/lib/libsvn_fs_fs-1.dylib /usr/lib/libsvn_fs_fs-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_fs-1.dylib /usr/lib/libsvn_fs-1.dylib ln -s -f /opt/subversion/lib/libsvn_fs-1.dylib /usr/lib/libsvn_fs-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_ra_local-1.dylib /usr/lib/libsvn_ra_local-1.dylib ln -s -f /opt/subversion/lib/libsvn_ra_local-1.dylib /usr/lib/libsvn_ra_local-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_ra_svn-1.dylib /usr/lib/libsvn_ra_svn-1.dylib ln -s -f /opt/subversion/lib/libsvn_ra_svn-1.dylib /usr/lib/libsvn_ra_svn-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_ra-1.dylib /usr/lib/libsvn_ra-1.dylib ln -s -f /opt/subversion/lib/libsvn_ra-1.dylib /usr/lib/libsvn_ra-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_wc-1.dylib /usr/lib/libsvn_wc-1.dylib ln -s -f /opt/subversion/lib/libsvn_wc-1.dylib /usr/lib/libsvn_wc-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_repos-1.dylib /usr/lib/libsvn_repos-1.dylib ln -s -f /opt/subversion/lib/libsvn_repos-1.dylib /usr/lib/libsvn_repos-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_subr-1.dylib /usr/lib/libsvn_subr-1.dylib ln -s -f /opt/subversion/lib/libsvn_subr-1.dylib /usr/lib/libsvn_subr-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_delta-1.dylib ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_delta-1.0.dylib ln -s -f /opt/subversion/lib/libsvn_diff-1.dylib /usr/lib/libsvn_diff-1.dylib ln -s -f /opt/subversion/lib/libsvn_diff-1.dylib /usr/lib/libsvn_diff-1.0.dylib
Step 4. Save the previous file on your Desktop. Open a new instance of Terminal.app and then type the following commands on it:
cd Desktop *press intro* sudo sh enable-svn.sh *press intro*
Congratulations! Xcode’s SCM feature will work now with installations of Subversion 1.5 or greater. To learn the basics about using the Subversion integration with Xcode, I recommend you read the section “Using Subversion from Xcode” on the following article:
http://developer.apple.com/mac/articles/server/subversionwithxcode3.html





December 11th, 2008 at 9:12 pm
WOW! You completely rock. Thank you so much for this. Worked like a charm. While I can use commandline svn, its too outside my usual workflow so I never check in. That’s dumb. I’m glad you helped prevent injury due to my own stupidity. Gracias
December 11th, 2008 at 9:15 pm
[...] http://www.lemonteam.com/blog/2008/12/setting-up-subversion-15-on-xcode/ [...]
December 25th, 2008 at 9:04 pm
It appears that while this may help XCode’s SCM problems, it also had the effect of breaking Apache2 so that it will no longer access http://localhost/ and also causes syslogd to run berserk.
Seems there’s something about the libapr-1.0.dylib library that it doesn’t like:
Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: dyld: Library not loaded: /usr/lib/libapr-1.0.dylib
Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: Referenced from: /usr/sbin/httpd
Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: Reason: no suitable image found. Did find:
Dec 25 11:54:09 Boat-2 org.apache.httpd[407]: /usr/lib/libapr-1.0.dylib: stat() failed with errno=62
Gonna be fun trying to “unfix” this little mess.
December 25th, 2008 at 10:04 pm
/usr/lib/libapr-1.0.dylib: stat() failed with errno=62
Sounds like a recursive symlink (a link pointing to itself, for instance). Try deleting /usr/lib/libapr-*, reinstalling latest svn and running the script again.
January 11th, 2009 at 7:00 am
I have a simular problem after trying this and have tried reinstalling svn 1.5 and running the script again.
1/10/09 10:59:26 PM org.apache.httpd[850] dyld: Symbol not found: _apr_socket_sendfile
1/10/09 10:59:26 PM org.apache.httpd[850] Referenced from: /usr/sbin/httpd
1/10/09 10:59:26 PM org.apache.httpd[850] Expected in: /usr/lib/libapr-1.0.dylib
1/10/09 10:59:26 PM com.apple.launchd[121] (org.apache.httpd[850]) Exited abnormally: Trace/BPT trap
1/10/09 10:59:26 PM com.apple.launchd[121] (org.apache.httpd) Throttling respawn: Will start in 10 seconds
January 21st, 2009 at 1:40 am
[...] Lemon Team’s blog » Blog Archive » Setting up Subversion 1.5 on Xcode [...]
January 23rd, 2009 at 4:50 pm
Thanks!! You saved me a lot of time! :D
February 13th, 2009 at 4:56 am
these lines are unnecessary
ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.dylib
ln -s -f /opt/subversion/lib/libsvn_delta-1.dylib /usr/lib/libsvn_diff-1.0.dylib
February 26th, 2009 at 12:55 am
Thanks I was grasping at straws trying to figure out why I kept getting a hook error needing a client 1.5 even though I had 1.5. It looks like the shell script was the answer thanks a lot!!
February 28th, 2009 at 3:16 am
To fix the “Symbol not found: _apr_socket_sendfile” problem I reverted the libapr and libaprutil links to the Apache 2.2.9 versions in /usr/lib and restarted Apache.
I’m now able to use both the Versions svn client as well as Xcode 3.1.2 with my svn 1.5.5 repository accessed via Apache 2.2.9 (setup with basic authentication).
March 11th, 2009 at 8:24 am
What does *press intro* mean?
March 11th, 2009 at 11:12 am
It means, press the enter/return/intro key to enter the commands.
March 11th, 2009 at 9:24 pm
Thanks a lot for this post.
March 19th, 2009 at 12:52 am
@Oliver GL Thanks a lot for posting your fix!!!!! You saved me =)
Thanks for the original post as well.