13

I have read about the targetBinary flag and I have also read this from a member of the Microsoft team working on CodePush.

I have version 5.0.1 and 5.1.0.

  • The second version has native differences when comparing to 5.0.1

If a bug comes in for version 5.0.1, how do I fix it and deploy it for this version only? Bugs may be critical and not everyone will have the latest version of the app.

Or, the bug may only exist on a specific version.

Is my only option to:

  • Open Xcode & Android Studio
  • Change my Bundle Versions/Build Number from 5.1.0 to 5.0.1 and then make a change, then change my numbering back?

This seems like a long-winded way of updating a version. Is there a more elegant way of managing this?

Dan
  • 8,041
  • 8
  • 41
  • 72
  • This question have not been properly answered. He is asking a very vital question when he says "The second version has native differences when comparing to 5.0.1". How can one push to an old version when the new version have some new native diff as regards to new packages been installed. cos if i am correct, the codepush to the old version of the app would install the new changes on the UI including the improt statements which would flag errors on the old versions .. – Okechukwu Eze Jun 28 '21 at 09:41

3 Answers3

26

The target binary version param supports ranges for this scenario. Here's a helpful table to guide you.

Range Expression    Who gets the update
----------------    ----------------------
1.2.3               Only devices running the specific binary app store version 1.2.3 of your app
*                   Any device configured to consume updates from your CodePush app
1.2.x               Devices running major version 1, minor version 2 and any patch version of your app
1.2.3 - 1.2.7       Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (inclusive)
>=1.2.3 <1.2.7      Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (exclusive)
1.2                 Equivalent to >=1.2.0 <1.3.0
~1.2.3              Equivalent to >=1.2.3 <1.3.0
^1.2.3              Equivalent to >=1.2.3 <2.0.0
  • 1
    If I push to all binary versions using '*'. It affects the newer versions as well, which are released after the code push update. How do I stop them? – Haseeb Burki Aug 01 '19 at 15:19
  • 2
    @HaseebBurki Just open the appcenter dashboard, and disable your release that targeted to`*`. Then release a new one – Brian Nguyen Apr 02 '20 at 08:14
  • 1
    @HaseebBurki You can always edit the version range in Microsoft app center https://appcenter.ms/ – rkkkk May 27 '20 at 13:30
  • is this table mentioned in the official docs? if not may i know where did you find this info? – ThinkAndCode Oct 30 '20 at 09:17
6

You can target a specific version with code push by choosing a different version using the target flag -t and the appcenter-cli

Target all versions of the app: appcenter codepush release-react -a Org/MyApp -t '*'

Target version 5.0.1 versions of the app: appcenter codepush release-react -a Org/MyApp -t '5.0.1'

Sam Hoult
  • 101
  • 4
-1

enter image description here

link to code push:

https://learn.microsoft.com/zh-cn/appcenter/distribution/codepush/cli#target-binary-version-parameter

1.2.3           Only devices running the specific binary version 1.2.3 of your app
*               Any device configured to consume updates from your CodePush app
1.2.x           Devices running major version 1, minor version 2, and any patch version of your app
1.2.3 - 1.2.7   Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (inclusive)
>=1.2.3 <1.2.7  Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (exclusive)
1.2             Equivalent to >=1.2.0 <1.3.0
~1.2.3          Equivalent to >=1.2.3 <1.3.0
^1.2.3          Equivalent to >=1.2.3 <2.0.0
suwu150
  • 1,209
  • 2
  • 8
  • 10