2 Answers2

8

You can try the following step, this may help you out:

  1. Manually set the CFBundleShortVersionString (aka "Bundle versions string, short") value in your info.plist to your major.minor build number (e.g. 1.0)

  2. Add a 'run script' build phase to your project with the following script

REV=`svnversion -nc | /usr/bin/sed -e 's/^[^:]*://;s/[A-Za-z]//'`
BASEVERNUM=`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${INFOPLIST_FILE}"`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BASEVERNUM.$REV" "${INFOPLIST_FILE}"

3.Clean and build (the Clean step forces Xcode to reprocess the info.plist).

enter image description here

Shekhar Gupta
  • 6,206
  • 3
  • 30
  • 50
  • This is an elegant solution, but for some reason the REV component in the script is always empty. At first I had thought that it was due to the client version of 1.7 not being updated on the Mac OS, but now that is resolved. I can see the desired output by putting it in the command line in the project directory. But it doesn't provide the input to my application as would be expected. The BASEVERNUM seems to get it's value though. Any thoughts? – Jay Snayder Apr 22 '13 at 15:53
0

Please be informed Xcode 5 brought changes to svn directory format. So if you have Xcode 4 and 5 both together installed and already converted svn project directory to new 1.7 format you loose svn functionality in Xcode 4 (missing status, svnversion doesn't work and so on). Fortunately Tommy Domain published a workaround for those who still use Xcode 4 and Xcode 5 on the same mac. You could find it here. Shortly, the solution could be:

  • Close Xcode 4.
  • Download and install svn 1.7 client (download link is here)
  • Go to inside the XCode4.app package, to where the SVN binaries are:

cd /Applications/Xcode.app/Contents/Developer/usr/bin/

  • Backup svn* files by moving them to any other directory:

mv svn* backup

  • Make a symbolical link to svn 1.7 client installed package:

ln -s /opt/subversion/bin/svn* ./

After that reopen Xcode 4 and enjoy svn tools working as well as solution from Shekhar Again, thanks to Tommy's Domain blog.

Community
  • 1
  • 1
Dmitry Varavkin
  • 239
  • 1
  • 4
  • 10