private static AppBundleRunner CreateAppBundleRunner()
        {
            var androidSdk = new AndroidSdk();
            var javaUtils  = new JavaUtils();
            var adb        = new AndroidDebugBridge(androidSdk);
            var bundletool = new BundletoolHelper(javaUtils);

            return(new AppBundleRunner(adb, bundletool));
        }
예제 #2
0
        /// <summary>
        /// Builds an APK Set (.apks) file from the specified Android App Bundle file (.aab).
        /// </summary>
        /// <param name="aabFilePath">An .aab file that was created by calling <see cref="BuildBundle"/>.</param>
        /// <param name="apksFilePath">An .apks output ZIP file containing APK files.</param>
        /// <param name="buildMode">The type of APKs to build from the Android App Bundle.</param>
        /// <param name="enableLocalTesting">
        /// If true, enables a testing mode where fast-follow and on-demand asset packs are fetched from storage
        /// rather than downloaded.
        /// </param>
        /// <returns>An error message if there was a problem running bundletool, or null if successful.</returns>
        public static string BuildApks(
            string aabFilePath,
            string apksFilePath,
            BundletoolBuildMode buildMode = BundletoolBuildMode.Default,
            bool enableLocalTesting       = false)
        {
            var bundletoolHelper = new BundletoolHelper(new JavaUtils());

            if (bundletoolHelper.Initialize(new BuildToolLogger()))
            {
                return(bundletoolHelper.BuildApkSet(aabFilePath, apksFilePath, buildMode, enableLocalTesting));
            }

            return("Failed to initialize bundletool.");
        }