A Node.js module that helps you update your Xcode project's marketing version and build version. This module provides functions to update the marketing version, update the build version, and get the current marketing and build versions.
npm install update-xcodeproj-version
$ update-xcodeproj-ver --help
Usage: update-xcodeproj-ver [options]
Options:
-V, --version output the version number
-p, --path <path> The path to the project.pbxproj file.
-m, --marketing <ver> The new marketing version you want to set.
-r, --reset If set to true, it will reset the build version to 1.
-h, --help output usage information
const path = require('path');
const {
updateXcodeMarketingVersion,
updateXcodeBuildVersion,
getMarketingVersion,
getBuildVersion,
} = require('update-xcodeproj-version');
const projectPath = path.join(__dirname, 'yourProjectName.xcodeproj', 'project.pbxproj');
(async () => {
// Update marketing version
await updateXcodeMarketingVersion(projectPath, "1.0.1", true);
// Update build version
await updateXcodeBuildVersion(projectPath, "5");
// Get marketing version
const marketingVersion = await getMarketingVersion(projectPath);
console.log('Marketing version:', marketingVersion);
// Get build version
const buildVersion = await getBuildVersion(projectPath);
console.log('Build version:', buildVersion);
})();
- path (string): The path to the project.pbxproj file.
- newVersion (string): The new marketing version you want to set.
- buildVersionReset (boolean): If set to true, it will reset the build version to 1.
Updates the marketing version of your Xcode project.
- path (string): The path to the project.pbxproj file.
- newVersion (string): The new build version you want to set.
Updates the build version of your Xcode project.
- path (string): The path to the project.pbxproj file.
Returns a Promise that resolves to the current marketing version of your Xcode project.
- path (string): The path to the project.pbxproj file.
Returns a Promise that resolves to the current build version of your Xcode project.
Returns the version of this module.
MIT License