Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increment Build & Version Number of Android App using Azure DevOps & App Centre

I am using Azure DevOps and AppCenter(Distribution) for implementing my CICD. Based on the steps mentioned below I have implemented the both CI & CD tasks.

Thant means,

I will create the build using Azure Devops (VSTS) & Push that in to App Centre.

Steps I Follow

Here my doubt is,

How I can increment my Build and Version numbers while distributing these builds?
enter image description here

like image 616
Stephan Ronald Avatar asked Jan 04 '19 10:01

Stephan Ronald


People also ask

How do I increase my build number?

You increment the build number each time a different build is seen outside your computer. For example, if you give a new build to QA it you increase the build number. If you are an automatic build system, you increase the build number. Yes, if you change the compiler, you treat that as a change of your source code.

What do build numbers mean?

A build number is a specific identifier that lets you know what software you're running as well as when it was updated last. That means your Android build number will change pretty frequently — maybe every month, depending on your device.

Does build number matter?

build number does not matter per se, but it is an easily trackable indication. For example, some devices are available for different carriers. Some carrier has locked bootloader, or other complications, and another does not.


2 Answers

For anyone still looking for an alternative method, try modifying either the version number, version name or both in the module build.gradle file like below:

 android {
    defaultConfig {
        applicationId 'com.sample.testapp'
        minSdk 28
        targetSdk 31
        versionCode 2
        versionName "2.2"
    }
    ...
  }
like image 129
Howard Hooper Avatar answered Sep 21 '22 18:09

Howard Hooper


The easy way is to install Mobile App Tasks for iOS and Android extension for Azure DevOps. You get a task "Bump Version" (for Andriod and iOS).

The task change app's version name and code at build time.

Inputs:

sourcePath - Path to android manifest

versionCode - code number that must be an integer (put the build number variable, it's incremented automatically)

versionCodeOffset - a specific number to increment the version code

versionName- user visible name

printFile - output the file before and after changing variables

Another option is to install Colin's ALM Corner Build & Release Tools extension and use the Version Assemblies task following this detailed tutorial.

Check also this question & answer.

like image 35
Shayki Abramczyk Avatar answered Sep 21 '22 18:09

Shayki Abramczyk