Automating the version code is a crucial step in the development process, as it ensures that the app is always updated with the correct version number. This is particularly important for production builds, as it allows you to easily track the version of your app that is being distributed to users.
It also prevents your app from being rejected by the app store if you submit a build with a version code that is lower or equal than the previous version.
Set a specific version code
You can set a specific version code for your app by running the following command:
eas build:version:setRemember to set the "appVersionSource" to be "remote" in the eas.json file. From here EAS will handle the version code for you.
App version vs build number
- App version is the version of the app that is being distributed to users. It is the version that is displayed in the app store and in the app settings.
- Build number is the version of the app that is being built. It is the version that is displayed in the build logs and in the app store.
Semantic Versioning
Semantic Versioning (SemVer) is a versioning scheme that uses the format MAJOR.MINOR.PATCH to indicate the version of the app.
MAJORis the major version, which is incremented when there are breaking changes.MINORis the minor version, which is incremented when new features are added.PATCHis the patch version, which is incremented when bug fixes are made.
Resources
- Source Code - Course Example App
- Semantic Versioning