- Home /
Open an exisiting project in desired platform
Hi there,
Just curious if anyone knows a solution to this. When I grab an exisiting project repository it always opens it as 'PC/Mac standalone' platform, it then does its asset converting magic. I then select the platform I actually want (iOs) and it converts again. Is there anyway to open the project in the desired platform in the first place?
Cheers,
Bob.
You mean you're saving the project each time with iOS selected as the target platform, but every time you reopen it it's reset back to PC/$$anonymous$$ac standalone? That shouldn't happen.
Hi, no thats not whats happening, although this may just be a hole in my source control knowledge! :-)
I download the repo, then in unity hit open exisiting project, select the root of the project and it opens in standalone - as part of opening it converts all the assets to that platform.
I then have to switch in build settings to the platform I actually want to run the project in, this does the same conversion of assets process but for that plat form type. I'm just trying to find out if that two stage process is needed - or if I could open it in iOs in the first place.
When I grab a repository does or can it have a unity platform associated with it?
Answer by DiegoSLTS · Sep 20, 2016 at 12:24 PM
Check the Command line arguments: https://docs.unity3d.com/Manual/CommandLineArguments.html
You can open the project at a certain path with -projectPath and select a build Target with -buildTarget
Answer by TristanChambers · Oct 18, 2021 at 03:16 PM
Just to update this, you can now choose the target platform you want the project to launch with in the unity hub. Just change the "Current Platform" dropdown to your desired platform instead.
If you still need to do this via the command line, an easy way to do this is to locate your unity.exe, create a shortcut for it, and edit the shortcuts target to have your desired platform in the command line. Then run the shortcut. Otherwise, just enter the command in the command line or terminal.
For example, I set my shortcut's target to this:
"C:\Program Files\Unity\Hub\Editor\2019.4.30f1\Editor\Unity.exe" -buildTarget StandaloneWindows64 -projectPath "D:\Projects\UnityProject\"
Note that I put quotes around the file paths in case there were spaces in them but they are not required if there are no spaces.
You can find the list of build targets here: https://docs.unity3d.com/ScriptReference/BuildTarget.html
Like @DiegoSLTS said, you can find other command line args here: https://docs.unity3d.com/Manual/CommandLineArguments.html
Your answer
Follow this Question
Related Questions
Once upon a build... 1 Answer
When i open a project, its blank? (noob, sorry) 1 Answer
Open Multiple Unity Projects Simultaneously 12 Answers
Do not want to open previous project 2 Answers
How do I simply re-open and edit a half-made script? 1 Answer