It's easy to set the build and version numbers manually in Xcode, and I learned how to increment them with a macro at build time. But how do I reference their values in code?
The versionCode is the incremental build number in Android. Show activity on this post. Every new upload of APK on Play Google requires versionCode to be different (ideally one up). This is a number.
A build number is a specific identifier that lets you know what software you're running as well as when it was updated last. That means your Android build number will change pretty frequently — maybe every month, depending on your device.
In a programming context, a build is a version of a program that, as a rule, is a pre-release version and is identified by a build number rather than by a release number. Simply put, a software build is a set of executable code that is ready for use by customers.
The version code is an incremental integer value that represents the version of the application code. The version name is a string value that represents the “friendly” version name displayed to the users.
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; NSString *appVersion = [infoDict objectForKey:@"CFBundleShortVersionString"]; // example: 1.0.0 NSString *buildNumber = [infoDict objectForKey:@"CFBundleVersion"]; // example: 42
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With