Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Extension: Is it necessary to increment its bundle version (CFBundleVersion)?

Do I have to increment the the CFBundleVersion in my extension's Info.plist to ensure it overwrites existing ones? Or if doing so in the main app's Info.plist is enough?

I'm working on today extension, but I guess the question applies to all embedded binaries.

like image 523
Joseph Lin Avatar asked Jan 14 '15 22:01

Joseph Lin


People also ask

What does cfbundleversion (string) mean?

Bookmark this question. Show activity on this post. This is my first iOS app submission and I don't want my app rejected. This is from the Apple Docs: CFBundleVersion (String - iOS, OS X) specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle.

What is the release or version number of the bundle?

The release or version number of the bundle. This key is a user-visible string for the version of the bundle. The required format is three period-separated integers, such as 10.14.1. The string can only contain numeric characters (0-9) and periods. Each integer provides information about the release in the format [ Major ]. [ Minor ]. [ Patch ]:

What is the difference between cfbundleversion and short version?

The "version" ( CFBundleVersion) is more of an internal version number that could change far more frequently than the public "short version". Personally I use the same for both but many people update the "version" on every build. Either way you typically update the "short version" when you release to Apple.

How to increment the version number of the release?

Increment Version Number:increment_version_numberaction can be used to increment the version number of the release. increment_version_number(bump_type: "major" # Automatically increment major version number)


Video Answer


2 Answers

Building on @atomkirk's answer, in my apps the version and build numbers are set in the xcodeproject. So instead of I need to use xcodebuild to pull out the relevant values:

buildNumber=$(xcodebuild -showBuildSettings -project App.xcodeproj | pcregrep -o1 "PROJECT_VERSION = ([0-9a-f\-]+)")
marketingVersion=$(xcodebuild -showBuildSettings -project App.xcodeproj | pcregrep -o1 "MARKETING_VERSION = ([0-9a-f\-.]+)")

/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$SRCROOT/Share Extension/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $marketingVersion" "$SRCROOT/Share Extension/Info.plist"
like image 163
weiran Avatar answered Oct 06 '22 23:10

weiran


I think Apple would actually prefer App Extensions to use the same bundle version as the app they are contained in. This is the email I have been getting from iTunes Connect with every submission:

We have discovered one or more issues with your recent delivery for "Awesome App". Your delivery was successful, but you may wish to correct the following issues in your next delivery:

CFBundleVersion Mismatch - The CFBundleVersion value '94' of extension 'Awesome App.app/PlugIns/Awesome App Today Extension.appex' does not match the CFBundleVersion value '99' of its containing iOS application 'Awesome App.app'.

CFBundleShortVersionString Mismatch - The CFBundleShortVersionString value '1.0' of extension 'Awesome App.app/PlugIns/Awesome App Today Extension.appex' does not match the CFBundleShortVersionString value '1.3.0' of its containing iOS application 'Awesome App.app'.

After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.

I can ignore these warnings and the build passes review but this is either a bug in iTunes Connect or the numbers should be the same. This doesn't actually make sense since the extension won't necessarily be updated at the same rate of the app. Anyways

like image 36
Daniel Galasko Avatar answered Oct 07 '22 01:10

Daniel Galasko