- Home /
Can you access Project Settings -> Player -> Other Settings -> Version via script at runtime?
Under Project Settings -> Player -> Other Settings there is a version field. Whatever you set here shows up as the version name in Google Play when you upload a build. Is there a way to get the contents of this Version field at runtime?
UnityEditor.PlayerSettings has a variety of info, including bundleVersion, but I cannot see anything for the Version field.
I'd like to be able to grab the version value to display in the UI at runtime.
Answer by Casper-Chimp · Jun 19, 2018 at 02:15 PM
Application.version is probably the value you're looking for.
Answer by abdullahsyyd · Jun 19, 2018 at 12:38 PM
To achieve this you need to write code in manifest file of your project. In manifest file you can set target sdk version and minimum adk version.
<uses-sdk android:minSdkVersion="14"
android:targetSdkVersion="19" />
Thanks for taking the time to reply, but I am not asking about sdk version. The two fields you are talking about are called $$anonymous$$inimum API Level and Target API Level in the Player settings window. Right above those there is another field simply called Version that I am asking about.
You can also access version through manifest file android:versionName="1.0"
Ok. I don't think there is a way to easily access the manifest file at runtime. I think I'd need to load the file and parse the contents. I was hoping there was a way that Unity exposed it for us.
Your answer
Follow this Question
Related Questions
Minimum API Level is set to 2.3.1 but Google Play says 4.1 and higher versions 1 Answer
Difference between Application.version and PlayerSettings.bundleVersion 1 Answer
If I set PlayerSettings "Target IOS Version" to 4.3 will this exclude iPhones3G and 3GS? 1 Answer
AssemblyInfo or alternative - How to add version number 1 Answer
Can I open a version controlled project with Unity Free? 1 Answer