unity .bundle_Unity 2018.3 Beta中对Android App Bundle(AAB)的支持

unity .bundle_Unity 2018.3 Beta中对Android App Bundle(AAB)的支持

unity .bundle

Larger apps and games convert fewer Google Play store visits into installs. This is because users are conscious of using up storage on their device, using up their data plans, and waiting around for downloads to complete on slow connections. Android App Bundle is a new Android app publishing format which makes games smaller on people’s device.

较大的应用和游戏将较少的Google Play商店访问转化为安装。 这是因为用户意识到要耗尽设备上的存储空间,耗尽其数据计划并等待下载完成才能通过慢速连接进行操作。 Android App Bundle是一种新的Android应用程序发布格式,可以使人们的设备上的游戏变小。

In Unity 2018.3 beta, we are introducing App Bundle support for some of the hardware configurations. Read on to learn how you can get started building an Android App Bundle instead of an APK! Larger games tend to be uninstalled first when users are looking to free up space on their device. This impacts users in all markets and is especially pronounced in markets where device storage and data is at a premium.

Unity 2018.3 beta中 ,我们引入了对某些硬件配置的App Bundle支持。 请继续阅读以了解如何开始构建Android App Bundle(而不是APK)! 当用户希望释放设备上的空间时,通常会首先卸载较大的游戏。 这会影响所有市场的用户,尤其是在设备存储和数据非常宝贵的市场中。

Android App Bundle includes all your game’s compiled code and resources, but defers APK generation and signing to Google Play. Google Play’s new app serving model, called Dynamic Delivery, then uses your app bundle to generate and serve optimized APKs for each user’s device configuration, so they download only the code and resources they need to run your app. You no longer have to build, sign, and manage multiple APKs to support different devices, and users get smaller, more optimized downloads.

Android App Bundle包含了您游戏的所有编译代码和资源,但推迟了APK的生成和对Google Play的签名。 Google Play的新应用程序服务模型称为动态交付,然后使用您的应用程序包为每个用户的设备配置生成并提供优化的APK,因此他们仅下载运行您的应用程序所需的代码和资源。 您不再需要构建,签名和管理多个APK以支持不同的设备,并且用户可以获得更小,更优化的下载。

Android App Bundles have multiple options to generate configuration APKs for each set of language resources, screen density resources, and ABI (Application Binary Interface, one for each combination of CPU and instruction sets), as well as of a new concept of Dynamic Features – see Google documentation for details.

Android App Bundle具有多个选项,可为每组语言资源,屏幕密度资源和ABI(应用程序二进制接口,每组CPU和指令集的组合)生成配置APK,以及动态功能的新概念– 有关详细信息,请参见Google文档

In Unity 2018.3, we are introducing App Bundle support for CPU architecture/ABI (ARMv7, ARM64 & x86) and we’re exploring additional targeting dimensions that will be useful for developers so we welcome your feedback. We’d love to get your opinion on our Android Developer Forum!

在Unity 2018.3中,我们引入了对CPU体系结构/ ABI(ARMv7,ARM64和x86)的App Bundle支持,并且我们正在探索对开发人员有用的其他定位维度,因此欢迎您提供反馈。 我们很乐意在我们的Android开发者论坛上获得您的意见!

建立Android应用程式套件 (Building the Android App Bundle)

First, open your project in Unity 2018.3 beta. To build an Android App Bundle (AAB) instead of an APK, open the Build Settings window (menu: File > Build Settings), and tick the Build App Bundle checkbox (the Build System needs to be Gradle which is the default option):

首先,在Unity 2018.3 beta中打开您的项目。 要构建Android App Bundle(AAB)而不是APK,请打开“ 构建设置”窗口(菜单:“ 文件” >“ 构建设置” ),然后选中“ 构建App Bundle”复选框(“构建系统需要为Gradle”是默认选项):

unity .bundle_Unity 2018.3 Beta中对Android App Bundle(AAB)的支持

If you select Build Unity will generate the AAB file which can be published directly to Google Play.

如果选择Build Unity,将生成AAB文件,该文件可以直接发布到Google Play。

If you select Build and Run, Unity will generate the AAB file, then it will generate temporary APK file(s) specific for the attached device, install them on your device and run your application.

如果选择Build and Run ,Unity将生成AAB文件,然后它将生成特定于所连接设备的临时APK文件,将其安装在设备上并运行您的应用程序。

If you select Build and want to install the app to a device manually you can use bundletool utility provided by Google (it can be found in Editor/Data/PlaybackEngines/AndroidPlayer/Tools directory of your Unity installation). You can read here about bundletool flags and options.

如果您选择Build并想手动将应用程序安装到设备上,则可以使用Google提供的bundletool实用程序 (可以在Unity安装的Editor / Data / PlaybackEngines / AndroidPlayer / Tools目录中找到该实用程序 )。 您可以在此处阅读关于bundletool标志和选项的信息。

Note that option Split APKs by target architecture (Edit > Setting > Player) is disabled when building app bundle because generated app bundle should include libraries for all supported targets.

请注意,构建应用程序捆绑包时,禁用了按目标体系结构拆分APK ( 编辑 > 设置 > 播放器 )选项,因为生成的应用程序捆绑包应包括所有受支持目标的库。

提示与技巧 (Tips & tricks)

During development, to decrease the iteration time when using Build and Run, it may be a good idea to disable app bundle generation and use a regular APK instead, because it takes additional time to generate APKs from an app bundle before deploying them to a device.

在开发过程中,为了减少使用“构建和运行”时的迭代时间,最好禁用应用程序包生成并改用常规APK,因为在将它们部署到设备上之前需要花费更多时间从应用程序包中生成APK。 。

An app bundle can also be generated from Android Studio, with Gradle project exported from Unity. For this you need to use Android Studio 3.2 or later and just select Build > Build Bundle(s) / APK(s) > Build Bundle(s).

也可以从Android Studio生成应用包,并从Unity导出Gradle项目。 为此,您需要使用Android Studio 3.2或更高版本,只需选择Build> Build Bundle(s / APK)> Build Bundle(s)即可

If you are targeting stores which don’t support Android App Bundles (currently it’s only supported by Google Play), you may want to use the Split APKs by target architecture option (in Player settings) instead to deliver APKs split by the CPU architecture of the end user device, or use the bundletool, which also allows you to build a “universal APK” that can run on any environment (see Android App Bundle doc).

如果您定位的商店不支持Android App Bundle(当前仅受Google Play支持),则可能要使用“ 按目标体系结构拆分APK”选项(在“播放器”设置中),而不是按CPU架构交付APK最终用户设备,或使用bundletool,它还允许您构建可在任何环境下运行的“通用APK”(请参阅Android App Bundle文档 )。

翻译自: https://blogs.unity3d.com/2018/10/03/support-for-android-app-bundle-aab-in-unity-2018-3-beta/

unity .bundle