public static void Build()
        {
            PlayerSettings.applicationIdentifier = "com.google.android.instantapps.samples.unity.testapp";
            PlayerSettings.companyName           = "Google";
            PlayerSettings.productName           = "testapp";

            CommandLineBuilder.ConfigureProject(TestScenePaths);


            var outputFilePrefix = CommandLineBuilder.GetOutputFilePrefix();
            var apkPath          = outputFilePrefix + ".apk";
            var aabPath          = outputFilePrefix + ".aab";

            var buildPlayerOptions = PlayInstantBuilder.CreateBuildPlayerOptions(apkPath, BuildOptions.None);

            if (!PlayInstantBuilder.BuildAndSign(buildPlayerOptions))
            {
                throw new Exception("APK build failed");
            }

            DownloadBundletoolIfNecessary();
            if (!AppBundlePublisher.Build(aabPath))
            {
                throw new Exception("AAB build failed");
            }
        }
        public static void Build()
        {
            PlayerSettings.applicationIdentifier = "com.google.android.instantapps.samples.unity.testapp";
            PlayerSettings.companyName           = "Google";
            PlayerSettings.productName           = "testapp";

            CommandLineBuilder.ConfigureProject(TestScenePaths);

            // Build APK.
            var apkPath            = CommandLineBuilder.GetApkPath();
            var buildPlayerOptions = PlayInstantBuilder.CreateBuildPlayerOptions(apkPath, BuildOptions.None);

            if (!PlayInstantBuilder.BuildAndSign(buildPlayerOptions))
            {
                throw new Exception("APK build failed");
            }

            // Also Build an AAB to test Android App Bundle build.
            DownloadBundletoolIfNecessary();
            var aabPath = apkPath.Substring(0, apkPath.Length - 3) + "aab";

            if (!AppBundlePublisher.Build(aabPath))
            {
                throw new Exception("AAB build failed");
            }
        }
Example #3
0
        public static void Build()
        {
            PlayerSettings.applicationIdentifier = "com.google.android.instantapps.samples.unity.sphereblast";
            PlayerSettings.companyName           = "Google";
            PlayerSettings.productName           = "Sphere Blast";

            CommandLineBuilder.ConfigureProject(ScenesInBuild);

            var apkPath            = CommandLineBuilder.GetOutputFilePrefix() + ".apk";
            var buildPlayerOptions = PlayInstantBuilder.CreateBuildPlayerOptions(apkPath, BuildOptions.None);

            if (!PlayInstantBuilder.BuildAndSign(buildPlayerOptions))
            {
                throw new Exception("APK build failed");
            }
        }