Version: 2023.2
言語: 日本語
public static int bundleVersionCode ;

説明

Android のバンドルバージョンコード

Should be less than 100000 for buildApkPerCpuArchitecture to generate valid version codes.

using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
public class BundleVersionCodeExample : MonoBehaviour
{
    [MenuItem("Build/Android Bundle Version Code Example")]
    public static void IncrementingBundleVersionExample()
    {
        PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
        PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
        PlayerSettings.Android.bundleVersionCode++;
        BuildPlayerOptions options = new BuildPlayerOptions();
        options.scenes = new[] { "Assets/Scenes/SampleScene.unity" };
        options.locationPathName = "Builds/AndroidBuild.apk";
        options.target = BuildTarget.Android;
        options.targetGroup = BuildTargetGroup.Android;
        BuildPipeline.BuildPlayer(options);
    }
}