Select UWP Platform By Default

Is there a way to ensure that when a project is opened in the Unity editor, UWP is the selected build platform by default?
I have a project that is not intended to be built on the default platform (PC, Mac & Linux Standalone). When the repository is pulled onto fresh environments or settings are cleared, Unity shows error messages when the project is opened and suggests opening in Safe Mode. The typical workflow is to click “Ignore”, then set the platform in Build Settings to Universal Windows Platform.
I’ve found that I can add a flag to the Advanced Project Settings in Unity Hub: “-buildTarget WindowsStoreApps”
This opens the project with UWP selected as intended, but I am unable to commit this flag to the source repository as it is not tracked by a file in the project (as tested with a blank project in a fresh git repository).

Can some Default Platform option be made available that can be committed to the project’s repository?

I found that committing the file Library/EditorUserBuildSettings.asset retains the UWP build target; however, there are many settings in this file that I do not intend to propagate to the team, as different developers have different build setting needs.

The setting everyone has in common is the UWP build target; can this setting be changed anywhere else, preferably in a human-readable format?

As you found, the setting is in the Library folder, and the Library folder is not intended to be committed to version control. What I would do is make changes to your project so it can open with the default standalone build target without error, and then have the people in your project manually change to UWP. That should eliminate the safe mode prompt.

You didn’t mention what the errors are, but if they are related to some DLL you can try disabling the DLL in standalone using the Plugin Inspector. If it is some of your code, you can try using Platform Dependent Compilation so Unity doesn’t attempt to compile code for standalone which is for UWP only. You don’t need to make it so your project actually runs correctly in standalone, just make it so it doesn’t fail to compile in standalone.

Is there any update?
I am facing the same problem. We have a project with a large amount of assets, which using lots of time when switching the platform.

1 Like