Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

update-xcodeproj-version

Kwonkunkun965MIT1.2.7

update xcodeproj's marketing & build version

xcodeproj, xcode, version, update, build, marketing, versioning

readme

update-xcodeproj-version

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.

Installation

npm install update-xcodeproj-version

Usage

$ 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);
})();

API

updateXcodeMarketingVersion(path, newVersion, buildVersionReset)

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

updateXcodeBuildVersion(path, newVersion)

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

getMarketingVersion(path)

  • path (string): The path to the project.pbxproj file.

Returns a Promise that resolves to the current marketing version of your Xcode project.

getBuildVersion(path)

  • path (string): The path to the project.pbxproj file.

Returns a Promise that resolves to the current build version of your Xcode project.

getPackageVersion()

Returns the version of this module.

License

MIT License

changelog

1.2.7 (2023-04-16)

1.2.6 (2023-04-13)

Bug Fixes

  • edit husky prepare-commit-msg hook (a2a876f)
  • edit prepare-commit-msg of husky hook (792d57d)

1.2.0 (2023-04-11)

Features

1.1.2 (2023-04-11)

Bug Fixes

  • updateXcodeMarketingVersion function bug fix (661e9d4)

1.1.1 (2023-04-09)

Bug Fixes

  • npm ignore: add .npmignore becuase upload not nessasary files in npm module (af0cb60)

1.1.0 (2023-04-09)

Features

  • add xcode project version helpe fuctions (ad9ec81)
  • bin: add update-xcodeproj-version bin (76e29ab)