VersionFrau for Android Gradle
Gradle plugin com.aralel.versionfrau · latest 0.0.18
- Sets
versionCodeandversionName - APK/AAB named
app-release-v1.0.4.aab - Product flavors & ABI splits supported
BuildConfig.BUILD_TIMEinjected
Free & open source · MIT · by Aralel GmbH
VersionFrau keeps your app's version in one small version.properties file and updates it on every build —
for Android (Gradle plugin) and Xcode (Swift package + command-line tool).
No more forgetting to raise versionCode or CFBundleVersion before an upload.
build + 1 → 1.0.3.42patch + 1, build → 0 → 1.0.4Give it this page or the plain-text file and say “add VersionFrau to this project”. Paste this prompt:
Read https://versionfrau.aralel.com/llms-full.txt and set up VersionFrau automatic versioning in this project. Detect whether it is an Android/Gradle project or an Xcode project and follow the matching instructions exactly. Do not invent other version numbers or plugin ids.
Instructions for the assistant:
settings.gradle(.kts) → Android/Gradle → follow VersionFrau for Android.*.xcodeproj → Xcode → follow VersionFrau for Xcode (CLI path: versionfrau install <App>.xcodeproj).version.properties format.versionCode/versionName (Android) or MARKETING_VERSION/CURRENT_PROJECT_VERSION (Xcode) only where the steps say so.version.properties (and on Xcode the copied versionfrau script and VersionFrau.xcconfig).Gradle plugin com.aralel.versionfrau · latest 0.0.18
versionCode and versionNameapp-release-v1.0.4.aabBuildConfig.BUILD_TIME injectedSwift package + versionfrau script · latest 0.0.19
Works with the Android Gradle Plugin 8.x and 9.x, Kotlin DSL and Groovy DSL, with or without product flavors. Plugin id com.aralel.versionfrau, published on Maven Central as com.aralel:versionfrau.
New Android Studio projects already have this — then skip to step 2.
settings.gradle.kts (project root)
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
app/build.gradle.kts
plugins {
id("com.android.application")
id("com.aralel.versionfrau") version "0.0.18"
}
app/build.gradle.kts
android {
defaultConfig {
versionCode = versionFrau.versionCode
versionName = versionFrau.versionName
}
}
Replace any hard-coded versionCode/versionName with these two lines. On the first build a version.properties file appears in the module folder (usually app/version.properties) — commit it.
| Command | Change | Output file |
|---|---|---|
./gradlew assembleDebug | build +1 | app-debug-v1.0.3.42.apk |
./gradlew bundleDebug | build +1 | app-debug-v1.0.3.42.aab |
./gradlew assembleRelease | patch +1, build = 0 | app-release-v1.0.4.apk |
./gradlew bundleRelease | patch +1, build = 0 | app-release-v1.0.4.aab |
./gradlew assembleFreeDebug | build +1 | app-free-debug-v1.0.3.42.apk |
Files are generated with the versioned name — older files in the output folder are never renamed. The version is incremented once per Gradle invocation, no matter how many flavors are built, and the version inside the APK/AAB always matches the file name.
| Property | Type | Debug | Release | Notes |
|---|---|---|---|---|
versionFrau.versionCode | Int | 1000003042 | 1000004000 | includes build only on debug |
versionFrau.versionName | String | 1.0.3.42 | 1.0.4 | includes build only on debug |
versionFrau.fullVersionName | String | 1.0.3.42 | 1.0.4.0 | always includes build |
versionFrau.major / minor / patch / build | Int | raw values on disk | ||
versionFrau.buildTime | String | Nov 23, 2026 | also BuildConfig.BUILD_TIME | |
./gradlew incrementBuildVersion
./gradlew incrementPatchVersion
./gradlew incrementMinorVersion # resets patch and build
./gradlew incrementMajorVersion # resets minor, patch and build
app/build.gradle.kts — optional custom file location (place it above android { })
versionFrau {
versionFile = file("config/version.properties")
}
For iOS, iPadOS, macOS, watchOS, tvOS and visionOS apps, including widgets and other app extensions. Builds only need a small bash script copied next to your project — no Ruby or Swift dependency at build time.
https://github.com/aralel/versionfrau-ios. Choose Up to Next Major Version from 0.0.19. Adding the VersionFrau library to your target is optional (only needed to read the version in Swift).xcodeproj Ruby gem).version.properties, VersionFrau.xcconfig and the copied versionfrau script.The same context menu has Bump Minor Version and Bump Major Version.
brew tap aralel/versionfrau-ios https://github.com/aralel/versionfrau-ios
brew install versionfrau-xcode
curl -fsSL https://raw.githubusercontent.com/aralel/versionfrau-ios/main/install.sh | bash
cd path/to/your/app
versionfrau install MyApp.xcodeproj
curl -fsSL https://raw.githubusercontent.com/aralel/versionfrau-ios/main/install.sh | bash -s -- MyApp.xcodeproj
| install option | Meaning |
|---|---|
--scheme <name> | Only add the pre-action to this shared scheme (default: all shared schemes) |
--target <name> | Only these targets, repeatable (default: all app and app-extension targets) |
--file <path> | Version file relative to the project dir, e.g. ../version.properties to share one version between projects |
versionfrau next to the .xcodeproj."${PROJECT_DIR}/versionfrau" increment to the shared scheme(s) — once per build."${PROJECT_DIR}/versionfrau" apply to every app and extension target, writing the version into the built Info.plist.ENABLE_USER_SCRIPT_SANDBOXING = NO on those targets.VersionFrau.xcconfig the project's base configuration and removes hard-coded MARKETING_VERSION / CURRENT_PROJECT_VERSION.Running it again is safe: it replaces its own phase and pre-action instead of duplicating them. Your source Info.plist is never modified.
| Key | Debug | Release |
|---|---|---|
CFBundleShortVersionString | 1.0.3 | 1.0.4 |
CFBundleVersion | 1000003042 | 1000004000 |
VersionFrauVersionName | 1.0.3.42 | 1.0.4 |
VersionFrauFullVersionName | 1.0.3.42 | 1.0.4.0 |
VersionFrauBuildTime | Nov 23, 2026 | |
import VersionFrau
Text("Version \(VersionFrau.versionName), built \(VersionFrau.buildTime)")
// also: VersionFrau.marketingVersion, .bundleVersion, .fullVersionName
// from an extension: VersionFrau.Info(bundle: Bundle(for: SomeClass.self))
./versionfrau print # all values
./versionfrau print marketingVersion # one value
./versionfrau bump build|patch|minor|major
Only the Release configuration counts as release by default. Change it with
VERSIONFRAU_RELEASE_CONFIGURATIONS="Release AppStore" in the pre-action and Run Script phase.
Both tools read and write the same file and use the same rules, so an Android app and an iOS app can carry identical versions.
version.properties
major=1
minor=0
patch=0
build=0
| Debug build | Release build / Archive | |
|---|---|---|
| Change | build + 1 | patch + 1, build = 0 |
| Version name | major.minor.patch.build | major.minor.patch |
| Version code / bundle version | major × 1,000,000,000 + minor × 1,000,000 + patch × 1,000 (+ build on debug) | |
The code always grows with every build and release, as Google Play and App Store Connect require. Minor and major versions are raised deliberately: ./gradlew incrementMinorVersion or versionfrau bump minor.
Yes. It is the source of truth. CI should build from the committed file; commit the bumped file after a release build.
Each part gets three digits in the code (minor, patch, build ≤ 999). On Android the versionCode is an Int and Google Play accepts at most 2,100,000,000, so keep major at 2 or below.
No. On Xcode, indexing and clean do nothing. On Android, only assemble… / bundle… tasks with a Debug or Release build type increment.
Yes. On Xcode the increment runs once in the scheme pre-action, before any target builds, so the app, widgets and other extensions all get the same CFBundleVersion — required by App Store Connect.
Yes. On Xcode use versionfrau install … --file ../version.properties; on Android set versionFrau { versionFile = rootProject.file("../version.properties") } above android { }. Xcode writes are locked, so parallel Xcode builds don't lose increments.
Nothing. Both tools are MIT-licensed open source by Aralel GmbH, Aachen. Issues and pull requests are welcome on GitHub.