I just want to output the version number of my ios application in a settings file.
I understand that I have to add the settings file to the application folder.
W
Another solution, without writing swift code is :
1/ Create a Setting bundle
This will create a new section for your app in the Settings of your device
2/ Modify the Root.plist
This will set what you want to display in your app settings - Inside your new Setting Bundle, right click on the Root.plist -> Open As -> Source Code
Copy Paste the Following code in it :
PreferenceSpecifiers
Title
About
Type
PSGroupSpecifier
DefaultValue
Key
version_preference
Title
Version
Type
PSTitleValueSpecifier
StringsTable
Root
3/ Create a Run Script
This will always get the version of your app from the Info.plist and display it in your app Settings
In the Newest Run Script section , Copy/Paste the following :
#Getting Current Version
VERSIONNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}")
#Setting the version number in settings
/usr/libexec/PlistBuddy -c "Set PreferenceSpecifiers:1:DefaultValue $VERSIONNUM" /Settings.bundle/Root.plist
Just replace YOUR-APP-NAME by your app name