Take the 2-minute tour ×

I wonder if there is a way to get your own app version in code after you put it in the "Summary" tab in xCode. One way seems to be to search Info.plist for CFBundleVersion key, but is there any other, easier, more convenient way?

share|improve this question
possible duplicate of How can my iphone app detect its own version number? –  Brad Larson Nov 1 '11 at 14:45
add comment

3 Answers

up vote 41 down vote accepted

You can find it in the main bundle. I think it's something like:

share|improve this answer
Yeah, I've just found a blog(pigtailsoft.com/blog/?p=35) that states that. Thanks anyway! Will accept answer in 6 mins:) –  Valentin Radu Oct 31 '11 at 18:18
Thank you, but @"CFBundleVersion" return the build not the version. You should get this object: @"CFBundleShortVersionString" –  MansApps Mar 8 at 15:31
add comment
share|improve this answer
add comment

I typically use the Build number (CFBundleVersion) to keep track of, well, the number of builds, and the Version number (CFBundleShortVersionString) for marketing purposes. I use a run script to auto-increment my build number and I update the version number manually before each new release. So if you want to include the actual Version number in your code as opposed to the Build number, use this:




Here's the run script that increments the build number for anyone interested:


buildNumber=$(($buildNumber + 1))
share|improve this answer
add comment

Your Answer


