versionfrau

Free & open source · MIT · by Aralel GmbH

Version numbers that bump themselves.

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.

Debug buildbuild + 1  → 1.0.3.42
Release build / Archivepatch + 1, build → 0  → 1.0.4

Using an AI coding assistant?

Give 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:

  1. Find settings.gradle(.kts) → Android/Gradle → follow VersionFrau for Android.
  2. Find *.xcodeproj → Xcode → follow VersionFrau for Xcode (CLI path: versionfrau install <App>.xcodeproj).
  3. Both found (e.g. a Flutter/KMP repo)? Set up each one; they use the same version.properties format.
  4. Remove hard-coded versionCode/versionName (Android) or MARKETING_VERSION/CURRENT_PROJECT_VERSION (Xcode) only where the steps say so.
  5. Commit version.properties (and on Xcode the copied versionfrau script and VersionFrau.xcconfig).

VersionFrau for Android Gradle

Gradle plugin com.aralel.versionfrau · latest 0.0.18

  • Sets versionCode and versionName
  • APK/AAB named app-release-v1.0.4.aab
  • Product flavors & ABI splits supported
  • BuildConfig.BUILD_TIME injected
github.com/aralel/versionfrau

VersionFrau for Xcode Swift · CLI

Swift package + versionfrau script · latest 0.0.19

  • Drives Xcode's Version and Build fields
  • App + all extensions always share one build number
  • iOS, macOS, watchOS, tvOS, visionOS
  • Install via Xcode, Homebrew or curl
github.com/aralel/versionfrau-ios

VersionFrau for Android Gradle plugin

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.

1. Make sure Maven Central is a plugin repository

New Android Studio projects already have this — then skip to step 2.

settings.gradle.kts (project root)

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

2. Apply the plugin

app/build.gradle.kts

plugins {
    id("com.android.application")
    id("com.aralel.versionfrau") version "0.0.18"
}

3. Use the version

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.

What happens on each build

CommandChangeOutput file
./gradlew assembleDebugbuild +1app-debug-v1.0.3.42.apk
./gradlew bundleDebugbuild +1app-debug-v1.0.3.42.aab
./gradlew assembleReleasepatch +1, build = 0app-release-v1.0.4.apk
./gradlew bundleReleasepatch +1, build = 0app-release-v1.0.4.aab
./gradlew assembleFreeDebugbuild +1app-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.

Extension properties

PropertyTypeDebugReleaseNotes
versionFrau.versionCodeInt10000030421000004000includes build only on debug
versionFrau.versionNameString1.0.3.421.0.4includes build only on debug
versionFrau.fullVersionNameString1.0.3.421.0.4.0always includes build
versionFrau.major / minor / patch / buildIntraw values on disk
versionFrau.buildTimeStringNov 23, 2026also BuildConfig.BUILD_TIME

Manual bumps & options

./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")
}

VersionFrau for Xcode Swift package · CLI

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.

Option A — in Xcode (Swift package)

  1. File → Add Package Dependencies… and enter 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).
  2. In the Project navigator, right-click the project → Install VersionFrau. Allow it to modify the project (and, the first time, to download the xcodeproj Ruby gem).
  3. Build. General → Version / Build now show the VersionFrau version. Commit version.properties, VersionFrau.xcconfig and the copied versionfrau script.

The same context menu has Bump Minor Version and Bump Major Version.

Option B — command line (CI, scripts, AI agents)

Homebrew

brew tap aralel/versionfrau-ios https://github.com/aralel/versionfrau-ios
brew install versionfrau-xcode

curl

curl -fsSL https://raw.githubusercontent.com/aralel/versionfrau-ios/main/install.sh | bash

Set up a project

cd path/to/your/app
versionfrau install MyApp.xcodeproj

…or in one step, without installing anything globally

curl -fsSL https://raw.githubusercontent.com/aralel/versionfrau-ios/main/install.sh | bash -s -- MyApp.xcodeproj
install optionMeaning
--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

What install changes

  1. Copies versionfrau next to the .xcodeproj.
  2. Adds a Build pre-action "${PROJECT_DIR}/versionfrau" increment to the shared scheme(s) — once per build.
  3. Adds a last Run Script phase "${PROJECT_DIR}/versionfrau" apply to every app and extension target, writing the version into the built Info.plist.
  4. Sets ENABLE_USER_SCRIPT_SANDBOXING = NO on those targets.
  5. Makes 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.

Values written into every built Info.plist

KeyDebugRelease
CFBundleShortVersionString1.0.31.0.4
CFBundleVersion10000030421000004000
VersionFrauVersionName1.0.3.421.0.4
VersionFrauFullVersionName1.0.3.421.0.4.0
VersionFrauBuildTimeNov 23, 2026

Read the version in Swift

import VersionFrau

Text("Version \(VersionFrau.versionName), built \(VersionFrau.buildTime)")
// also: VersionFrau.marketingVersion, .bundleVersion, .fullVersionName
// from an extension: VersionFrau.Info(bundle: Bundle(for: SomeClass.self))

Commands

./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.

The shared version scheme

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 buildRelease build / Archive
Changebuild + 1patch + 1, build = 0
Version namemajor.minor.patch.buildmajor.minor.patch
Version code / bundle versionmajor × 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.

FAQ

Do I need to commit version.properties?

Yes. It is the source of truth. CI should build from the committed file; commit the bumped file after a release build.

Why is the patch or build number limited?

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.

Does a Clean build or indexing increment the version?

No. On Xcode, indexing and clean do nothing. On Android, only assemble… / bundle… tasks with a Debug or Release build type increment.

Do my app and its extensions get the same build number?

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.

Can several projects share one version?

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.

What does it cost?

Nothing. Both tools are MIT-licensed open source by Aralel GmbH, Aachen. Issues and pull requests are welcome on GitHub.