Mobile Preview via command line?

Is it possible to launch the mobile preview of a project via the command line? I found the -game switch but didn’t see any documentation as to how to possibly execute the mobile preview from it. Is there a way to inspect how the unreal editor launches the mobile previewer?

Thanks,
-jv

1 Like

-FeatureLevelES2 should do the trick. The mobile preview from the editor also specifies -faketouches to make the mouse behave like touch events (not needed if your project has that globally set).


	// apply additional settings
	if (bPlayUsingMobilePreview)
	{
		AdditionalParameters += TEXT(" -featureleveles2 -faketouches");
	}

Cheers,
Michael Noland

1 Like

To be more specific, it is according to your mobile view feature level.


So for me in ue4.27, the parameter should be “-game -featureleveles31 -faketouches”
You can find relevant code in UnrealEngine-4.27.2\Engine\Source\Editor\UnrealEd\Private\PlayLevelNewProcess.cpp UEditorEngine::LaunchNewProcess.
And here is a complete example of commandline parameter.
“path/to/your/project/name.uproject” /Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap -game -PIEVIACONSOLE -Multiprocess GameUserSettingsINI=“path/to/your/project/Saved/Config/Windows/PIEGameUserSettings0.ini” -MultiprocessSaveConfig -forcepassthrough -messaging -SessionName=“Play in Standalone Game” -featureleveles31 -faketouches -MultiprocessSaveConfig -windowed -ResX=1280 -ResY=720