Skip to content

Commit

Permalink
Update build-versioning.md, added information on how Flutter versions… (
Browse files Browse the repository at this point in the history
#1934)

* Update build-versioning.md, added information on how Flutter versions iOS; how info.plist should be configured

Added how to ensure that Flutter pubspec.yaml version name and codes make their way into the iOS app build.

Works by ensuring the keys CFBundleShortVersionString and CFBundleVersion have the right values.

* Update build-versioning.md

* Update build-versioning.md

all things resolved.
  • Loading branch information
kulakarla authored Aug 4, 2023
1 parent a3e300f commit f588c71
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions content/knowledge-codemagic/build-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,18 @@ You can find the Google Play build versioning requirements in the [Android docum

Flutter generalizes iOS and Android build versioning with the [pubspec.yaml **version** property](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/app/pubspec.yaml.tmpl#L9-L19). This is a value in the form `{major}.{minor}.{patch}+{build_number}` (e.g. `1.2.3+45`). In Flutter builds, the value for build name, `{major}.{minor}.{patch}`, sets `CFBundleShortVersionString` for iOS and `versionName` for Android. While the optional build number, `{build_number}`, sets `CFBundleVersion` for iOS and `versionCode` for Android. With `flutter build` commands these values can be overridden with the command line arguments `--build-name` and `--build-number` or by setting the environment variables `FLUTTER_BUILD_NAME` and `FLUTTER_BUILD_NUMBER`.

In order to complete an automatic build versioning process for Flutter iOS apps, make sure the following keys along with their string values are set in `ios/Runner/info.plist`:

{{< highlight bash "style=paraiso-dark">}}
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
{{< /highlight >}}

It is advisable to set your build version (e.g. `1.2.3`) in the `pubspec.yaml` `version` property and commit this to version control, as this will only change on every app release. On the other hand, you should consider having your CI/CD pipeline increment and set build number automatically, as this should be updated for every build.


<br>

---
Expand Down

0 comments on commit f588c71

Please sign in to comment.