Home > other >  Export Unity Project as Android Studio Project via Command Line
Export Unity Project as Android Studio Project via Command Line

Time:03-29

I have a unity3D project and I want to build to android target. But how to specific the 'Export Project' flag in command line argument? enter image description here Anyone knows?

My build script:

BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
buildPlayerOptions.scenes = scenes;
buildPlayerOptions.locationPathName = "AndroidBuild";
buildPlayerOptions.target = BuildTarget.Android;
buildPlayerOptions.options = BuildOptions.None;
BuildPipeline.BuildPlayer(buildPlayerOptions);

CodePudding user response:

If you want to update Export Project option in Player Settings you will have to set BuildOptions with AcceptExternalModificationsToPlayer. You can find more information here: Documentation.

There is also way to update this using UnityEditor settings:

EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
  • Related