- Home /
Which file determines build platform?
I'm trying to find out where the chosen build platform is saved. For example, I open Unity, build platform is set to PC and Mac Standalone, I change it to iOS, quit Unity, deleted the Library folder, open Unity and the build platform is back to PC and Mac Standalone. So, is the relevant file in Library? And which file is it?
Thanks!
Answer by Kryptos · Sep 13, 2012 at 11:44 AM
It's PlayerBuildSettings.asset I think.
This is a very old answer, but it was the first hit on google at this time so worth a reply. I just wanted to note that it doesn't seem true anymore (if ever), as with 2019.4 LTS. That file doesn't even exist. But as mentioned below Library/EditorUserBuildSettings.asset does exist. So that could be it.
Answer by Bunny83 · Sep 13, 2012 at 11:01 AM
All project settings are usually stored in the project database which is represented by the library folder. It's probably a binary field in one of the database files. You really shouldn't change it manually. Unity has to do a lot conversions when you switch the build platform. Maybe write an editor script which switches the platform?
Thanks! I don't want to manully change it, I just want my project to be set to iOS as default when I clone it from git.
Answer by kyle-misner-kriel · Sep 08, 2017 at 06:53 PM
My guess would be Library/EditorUserBuildSettings.asset, but you can probably determine it from AssetImportState.
With a new project git control project with Forced Text asset serialization, I'm switching between ios and android. The only changed files I'm seeing are:
Library/AssetImportState (right away, the rest are saved with the project)
Library/assetDatabase3 (binary)
Library/EditorUserBuildSettings.asset (binary)
Library/metadata// (sometimes multiple)
For me, it looks like AssetImportState has the ascii value "13;589824;2304;-1" for ios and "9;16842754;65792;-1" for android. Which seems different enough for a check, but it gets reverted upon reload.
EditorUserBuildSettings.asset is a binary file and appears to be the authority of which platform the project is pointing to.
FYI, this is using Unity 5.4.4p2 which doesn't exist in 2012. Hope this helps anyway.
Answer by xykong · Jun 13, 2018 at 10:14 AM
Library/PlayerDataCache/ScriptLayoutHashes.txt is work for me.
You can get the platform string by the following example:
➜ cat ContinuousBuildStandaloneWindows64/Library/PlayerDataCache/ScriptLayoutHashes.txt | head -n1
WindowsStandalone
➜ cat ContinuousBuildStandaloneOSX/Library/PlayerDataCache/ScriptLayoutHashes.txt | head -n1
OSXStandalone
➜ cat ContinuousBuildIOS/Library/PlayerDataCache/ScriptLayoutHashes.txt | head -n1
iOS
➜ cat ContinuousBuildAndroid/Library/PlayerDataCache/ScriptLayoutHashes.txt | head -n1
Android
Your answer
Follow this Question
Related Questions
Platform strings used in SetPlatformTextureSettings() 2 Answers
Unity Randomly changes build Platform? 0 Answers
How do i delete/ reset unity to its normal settings? 2 Answers
When I build my game, I want the resolution to be already set. 1 Answer
Building Error:Unsafe code may only appear if compiling with /unsafe 0 Answers