Skip to content

Instantly share code, notes, and snippets.

@andreas-nesheim
Created October 16, 2017 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreas-nesheim/b80daca15286fabd980d8daa8183b89c to your computer and use it in GitHub Desktop.
Save andreas-nesheim/b80daca15286fabd980d8daa8183b89c to your computer and use it in GitHub Desktop.
# get current build number
build_number = get_info_plist_value(
key: 'CFBundleVersion',
path: 'path/to/projects/Info.plist'
)
# convert the build number from string to int, increment and convert back to string
build_number = Integer(build_number)
build_number += 1
build_number = build_number.to_s
# set incremented build number
set_info_plist_value(
key: 'CFBundleVersion',
value: build_number,
path: 'path/to/projects/Info.plist'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment