Unity Android packaging continuous integration issues multiple APKs at once to solve the problem (automatic script packaging APK)

Solutions:

1. First use Unity to type out the Android project, and then use the Android project for packaging

1) Modify CommandBuild.cs

Modify in public static void Build() method

        {
			locationPathName ="Android_Build";
			buildOption |= BuildOptions.AcceptExternalModificationsToPlayer;
			BuildPipeline.BuildPlayer(ms_scenes, locationPathName, ms_buildTarget, buildOption);
        }

About BuildOptions.AcceptExternalModificationsToPlayer; configuration related literature view

https://docs.unity3d.com/ScriptReference/BuildOptions.AcceptExternalModificationsToPlayer.html

Description

Used when building Xcode (iOS) or Eclipse (Android) projects.

On iOS, this setting will append an existing Xcode project. Existing Xcode project setting changes will be preserved. With the IL2CPP scripting backend, this setting will also allow incremental builds of the generated C++ code to work in Xcode.

On Android, this setting will create a new Eclipse project. Existing Eclipse project setting changes will be discarded.

2) Then use the gradle command to package

gradle -p ./(Project_Name) assembleRelease

 

2. Directly modify CommandBuild.cs to print multiple APKs

Modify CommandBuild.cs to support the generation of multiple APK files, which is theoretically feasible, to be studied

Guess you like

Origin blog.csdn.net/xlyrh/article/details/94723000