Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add SVN revision number to iPhone Application Build?

I have tried a lot of scripts in xCode such as:

Insert Subversion revision number in Xcode

http://getsetgames.com/2009/10/21/automatically-insert-your-svn-revision-number-into-your-xcode-project/

http://www.red-sweater.com/blog/23/automatic-build-sub-versioning-in-xcode

http://www.noxeos.com/2011/09/13/xcode-build-number-svn/

http://bafford.com/2010/11/17/automatic-build-versioning-in-xcode-with-subversion/

but it wasn't work.

I need to know how to add SVN revision number to iPhone App.

Thanks!

like image 283
pritam001 Avatar asked Dec 12 '12 05:12

pritam001


People also ask

How do I find my svn revision number?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

What is revision number in svn?

As you saw in the section called “Revisions”, revision numbers in Subversion are pretty straightforward—integers that keep getting larger as you commit more changes to your versioned data.

How do I revise in svn?

"svn info --show-item revision" will give the current revision to which the current directory is updated.


1 Answers

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

like image 50
Shekhar Gupta Avatar answered Nov 15 '22 05:11

Shekhar Gupta