Mobile Application
Use Case: Mobile Application Versioning with Versioning Tools API
Context
In mobile application development, managing versions correctly is crucial for tracking changes, distributing updates, and maintaining consistency. This use case describes how a developer can use the Versioning Tools API to automate versioning locally. This process will help ensure that each release is correctly versioned and tagged, streamlining the development and release cycle.
Scenario
A developer is working on a mobile application and has completed a new feature. To prepare for the release, the developer needs to:
Retrieve the next semantic version from the Versioning Tools API.
Update the application’s version in the local codebase.
Tag the version in the version control system (Git).
Prepare the application for deployment.
Step-by-Step Guide
1. Retrieve the Next Version Identifier
The developer needs to get the next semantic version for the mobile application. This step involves calling the Versioning Tools API.
Command:
Explanation:
myMobileApp
: Replace with your service ID, representing the mobile application.YOUR_API_KEY
: Replace with your API key.
Response:
The response provides the next version number, for example, 2.1.0
.
2. Update the Application’s Version
Next, update the mobile application’s version in the local codebase. The method to update the version will depend on the mobile platform (e.g., Android, iOS).
For Android:
Update
build.gradle
:Open
app/build.gradle
.Modify the
versionCode
andversionName
:
Explanation:
versionCode
: An integer representing the version number for the APK. Increment this for each new release.versionName
: The human-readable version string.
For iOS:
Update
Info.plist
:Open
Info.plist
.Update the
CFBundleShortVersionString
andCFBundleVersion
:
Explanation:
CFBundleShortVersionString
: The version number shown to users.CFBundleVersion
: The build number for internal tracking.
3. Tag the Version in Git
Once the local codebase is updated, tag the new version in the Git repository.
Command:
Explanation:
v2.1.0
: The version received from the API.-m "Release version 2.1.0"
: A message describing the tag.
4. Push the Tag to the Remote Repository
After tagging the version locally, push the tag to the remote repository.
Command:
Explanation:
origin
: The name of the remote repository.v2.1.0
: The tag being pushed.
5. Prepare for Deployment
Prepare the application for deployment to the respective app stores (Google Play Store, Apple App Store). Ensure that:
Build Artifacts: Build the application with the updated version.
Release Notes: Update release notes or changelogs with information about the new version.
App Store Configuration: Ensure the version number and build metadata match what you have set locally.
Example Workflow
Here is an example workflow a developer might follow:
Complete Feature Development:
Implement new features and ensure all tests pass.
Retrieve the Next Version:
Update the Application’s Version:
For Android or iOS, update the respective configuration files with
NEXT_VERSION
.
Tag the Repository:
Push the Tag:
Prepare for Deployment:
Build the application and update relevant deployment documentation.
Last updated