Version management in XCode
up:: iOS Development
Related:
Links:
- Automating Build Number Increments in Xcode with Custom Format: A Practical Guide | by Mateusz Siatrak | Medium
- Easily Keep Build Numbers And Marketing Versions In Sync | The Swift Dev Blog
- agvtool: Automating iOS Build and Version Numbers | by Shashikant Jagtap | XCBlog | Medium
Pre-release versions
I find it challenging that XCode doesn’t support pre-release versions. Here is a strategy:
- Each production build is a multiple of 100
- Each TestFlight build is >100
Example
- Release 1.0.0 (100) to Prod and Beta
- Notice a bugfix, and ship to Beta: 1.0.0 (101)
- Implement a feature on Beta: 1.0.0 (110)
- Package up changes on Beta. Release 1.1.0 (100) to Prod and Beta.
Automation
- In Xcode, open your project, then select your target.
- Go to the Build Phases tab.
- Click the + button in the top-left and select New Run Script Phase.
- In the new script section, paste the following code:
- Make sure this script runs before the “Compile Sources” phase by dragging it above in the Build Phases list.