How do you update the iOS & Android app version in Ionic w/ Capacitor?

Viewed 17304

I am developing an app using Ionic and Capacitor. Builds are generated using Ionic's new AppFlow service, so I don't build them locally.

How do I go about updating the iOS and Android version numbers? I've tried updating the plist and config.xml, but all updates result in a version number of "1.0", regardless of what I do.

3 Answers

So, Capacitor is neat! The android and ios configs are actually committed to source control. To update version number, simply update the following files:

  • Android - android/app/build.gradle (you're looking for the versionName variable)
  • iOS - ios/App/App/Info.plist *(you're looking for the CFBundleShortVersionString key)

In Android Studio 4.2.1 We can set version values in File > Project Structure > Modules > Default Config

enter image description here

I have made a custom version of the package standar-version to update the package.json, IOS(./ios/App/App.xcodeproj/project.pbxproj) and Android (./android/app/build.gradle) file after each commit on master, you can check it there: https://github.com/Cap-go/capacitor-standard-version In the doc, you have the example to use in GitHub Action

This tool has been made for the open-source Appflow alternative capacitor-updater

Related