Is there a way to target platform specific version for iOS and android through app.json or app.config.js?

Hi I’m on expo sdk 47.0.0
I have an iOS app already on app store and I’m ready with android app as well.
So here the scenario is: different version number requirement for iOS and android.
For example: I wish to launch android app with version: 0.0.1(may be) and iOS app with version: 2.0.1
I want to automate the version related stuffs for both platform. I don’t like to keep an eye on version number in app.js each time I build the app for different platform.
So is there some way to achieve what I want?
Any help would be appreciated.
Thank you.

this is a little more awkward than it could be, but you can use app.config.js to switch the version depending on the build profile or some environment variable. if you can use the same version on both platforms that would be much easier for you.

Thanks @brents
It looks good approach though if there’s no OR ways :slightly_smiling_face:

This is how I’m trying to achieve that behaviour:

In ./eas.json

"staging": {
      "distribution": "store",
      "channel": "staging",
      "env": {
        "API_ENV": "staging"
      },
      "android": {
        "buildType": "app-bundle",
        "autoIncrement": "versionCode"
      },
      "ios": {
        "buildConfiguration": "Release",
        "autoIncrement": "buildNumber"
      }
    },
    "staging-ios": {
      "extends": "staging",
      "env": {
        "BuildType":"ios"
      }
    },
    "staging-android": {
      "extends": "staging",
      "env": {
        "BuildType":"android"
      }
    },

And inside ./app.config.js

return {
    ...config,
    "version": process.env.BuildType === "ios" ? config.version : "0.0.1",
    ...
}

And I build with
eas build --profile staging-android -p android

eas build --profile staging-ios -p ios

A minor issue with it is I still have to pass -p (–platform)

What do you say @brents ?