Skip to content

Sets the Build Number to the specified value in the Info.plist file for the next build

License

Notifications You must be signed in to change notification settings

bitrise-steplib/steps-set-xcode-build-number

Repository files navigation

Set Xcode Project Build Number

Step changelog

Set the value of your iOS app's build number to the specified version number.

Description

Set the value of your iOS app's build number to the specified version number. A great way to keep track of versions when submitting bug reports.

If your IPA contains multiple build targets, they need to have the same version number as your app's main target has. In that case, you need to add this Step to your Workflow for each build target: if you have, say, three targets, you need to have three instances of this Step in your Workflow. If there are targets with different version numbers the app cannot be submitted for App Review or Beta App Review.

Configuring the Step

The step can handle if versions numbers are specified in the project file (default configuration since Xcode 13) and the old style where the version numbers appear in the Info.plist file. It can automatically detect which style is used and act accordingly.

For the simple projects you do not need to do anything because the step uses the previously defined $BITRISE_PROJECT_PATH and $BITRISE_SCHEME env vars to detect the target settings.

For better customisation the step can be also instructed to look for a specific target and even for specific target configurations to update the version numbers.

Useful links

Related Steps

🧩 Get started

Add this step directly to your workflow in the Bitrise Workflow Editor.

You can also run this step directly with Bitrise CLI.

⚙️ Configuration

Inputs
Key Description Flags Default
project_path Xcode Project (.xcodeproj) or Workspace (.xcworkspace) path. required $BITRISE_PROJECT_PATH
scheme Xcode Scheme name. required $BITRISE_SCHEME
target Xcode Target name. It is optional and if specified then the step will find the given target and update the version numbers for it. If it is left empty then the step will use the scheme's default target to update the version numbers.
configuration Xcode Configuration name. It is optional and if specified then the step will only update the configuration with the given name. If it is left empty then the step will update all of the target's configurations with the build and version number.
build_version This will be either the CFBundleVersion in the Info.plist file or the CURRENT_PROJECT_VERSION in the project file. required $BITRISE_BUILD_NUMBER
build_version_offset This offset will be added to build_version input's value. It must be a positive number.
build_short_version_string This will be either the CFBundleShortVersionString in the Info.plist file or the MARKETING_VERSION in the project file. If it is empty then the step will not modify the existing value.
Outputs
Environment Variable Description
XCODE_BUNDLE_VERSION The bundle version used in either in Info.plist or project file

🙋 Contributing

We welcome pull requests and issues against this repository.

For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.

Learn more about developing steps: