Sajjad
Sajjad

Reputation: 1615

Read Build number from .xcconfig file like Version number in Xcode

i created this Release.xcconfig:

SB_APP_NAME = Test
SB_APP_VERSION = 0.5
SB_APP_BUILD = 5
SB_APP_BUNDLE_ID = com.test.ios

and now i can use SB_APP_VERSION in info.plist like this:

enter image description here

but i can't find any key for build number in plist file to replace it from my xcconfig file.

as you can see, we have Version and Build in General tab of project. i want to read this number from xcconfig

enter image description here

Upvotes: 1

Views: 1638

Answers (1)

Sajjad
Sajjad

Reputation: 1615

If we see in info.plist file, we can find Bundle version string (short) and Bundle version. so:

Bundle version string (short) => App Version ( in general tab ) ( like 5.3.1 )

Bundle version => App Build ( in general tab ) ( like any int number )


So we can replace Bundle Version value as $(SB_APP_BUILD)

Upvotes: 1

Related Questions