|
| 1 | +# Version Management Guide |
| 2 | + |
| 3 | +## Version Terminology |
| 4 | + |
| 5 | +This project uses two version identifiers: |
| 6 | + |
| 7 | +### VERSION_NAME (MARKETING_VERSION in Xcode) |
| 8 | +- **What**: User-facing version number (e.g., "1.1.2") |
| 9 | +- **Where**: Displayed in App Store and Settings |
| 10 | +- **Format**: MAJOR.MINOR.PATCH |
| 11 | +- **When to change**: For feature releases and updates |
| 12 | + |
| 13 | +### VERSION_CODE (CURRENT_PROJECT_VERSION in Xcode) |
| 14 | +- **What**: Build number (e.g., "28", "29", "30") |
| 15 | +- **Where**: Used internally by Apple for tracking builds |
| 16 | +- **Format**: Integer that must always increase |
| 17 | +- **When to change**: Every single build uploaded to TestFlight/App Store |
| 18 | + |
| 19 | +## ✅ Centralized Version Configuration |
| 20 | + |
| 21 | +**Versions are now defined in ONE place only!** |
| 22 | + |
| 23 | +The version numbers are defined at the project level and automatically inherited by all targets (Debug and Release). |
| 24 | + |
| 25 | +### How to Update Versions |
| 26 | + |
| 27 | +To update versions, you only need to modify **2 locations** in `V2er.xcodeproj/project.pbxproj`: |
| 28 | + |
| 29 | +1. Search for the **Debug** project configuration and update: |
| 30 | +``` |
| 31 | +/* Debug project configuration */ |
| 32 | +MARKETING_VERSION = 1.1.2; /* VERSION_NAME */ |
| 33 | +CURRENT_PROJECT_VERSION = 29; /* VERSION_CODE */ |
| 34 | +``` |
| 35 | + |
| 36 | +2. Search for the **Release** project configuration and update: |
| 37 | +``` |
| 38 | +/* Release project configuration */ |
| 39 | +MARKETING_VERSION = 1.1.2; /* VERSION_NAME */ |
| 40 | +CURRENT_PROJECT_VERSION = 29; /* VERSION_CODE */ |
| 41 | +``` |
| 42 | + |
| 43 | +That's it! The target configurations will automatically inherit these values. |
| 44 | + |
| 45 | +## Important Notes |
| 46 | + |
| 47 | +1. **Both values must be updated** in both Debug and Release configurations |
| 48 | +2. **VERSION_CODE must always increase** - even for the same VERSION_NAME |
| 49 | +3. **Fastlane auto-increment**: Our Fastlane setup automatically increments VERSION_CODE for TestFlight builds |
| 50 | +4. **Info.plist**: Automatically uses these values via: |
| 51 | + - `$(MARKETING_VERSION)` → CFBundleShortVersionString (VERSION_NAME) |
| 52 | + - `$(CURRENT_PROJECT_VERSION)` → CFBundleVersion (VERSION_CODE) |
| 53 | + |
| 54 | +## Example Version Progression |
| 55 | + |
| 56 | +| VERSION_NAME | VERSION_CODE | Notes | |
| 57 | +|-------------|--------------|-------| |
| 58 | +| 1.1.0 | 27 | Previous release | |
| 59 | +| 1.1.1 | 28 | Bug fix release | |
| 60 | +| 1.1.2 | 29 | First build of 1.1.2 | |
| 61 | +| 1.1.2 | 30 | Second build of 1.1.2 (bug fix) | |
| 62 | +| 1.1.2 | 31 | Final 1.1.2 for App Store | |
| 63 | +| 1.2.0 | 32 | Next feature release | |
| 64 | + |
| 65 | +## Why Two Separate Values? |
| 66 | + |
| 67 | +- **VERSION_NAME**: What users see and understand |
| 68 | +- **VERSION_CODE**: Ensures every upload to Apple is unique |
| 69 | +- Multiple builds of the same version can exist (e.g., testing different fixes) |
| 70 | +- Apple requires VERSION_CODE to always increase for tracking |
0 commit comments