做好应用程序发布准备Preparing an Application for Release

应用程序经编码和测试后,必须准备一个包进行分发。After an application has been coded and tested, it is necessary to prepare a package for distribution. 准备此包的第一个任务是生成供发布的应用程序,其中主要涉及到设置应用程序的一些属性。The first task in preparing this package is to build the application for release, which mainly entails setting some application attributes.

使用以下步骤生成供发布的应用:Use the following steps to build the app for release:

  • 指定应用程序图标 – 每个 Xamarin.Android 应用程序应指定一个应用程序图标。Specify the Application Icon – Each Xamarin.Android application should have an application icon specified. 虽然在技术层面并不需要这么做;但是,某些应用商店(例如 Google Play)对此提出了要求。Although not technically necessary, some markets, such as Google Play, require it.

  • 应用程序版本控制 – 此步骤涉及初始化或更新版本信息。Version the Application – This step involves initializing or updating the versioning information. 这对应用程序将来的更新以及确保用户知道安装的应用程序版本非常重要。This is important for future application updates and to ensure that the users are aware of which version of the application they have installed.

  • 压缩 APK – 通过托管代码上的 Xamarin.Android 链接器和 Java 字节码上的 ProGuard,可大幅压缩最终 APK 。Shrink the APK – The size of the final APK can be substantially reduced by using the Xamarin.Android linker on the managed code and ProGuard on the Java bytecode.

  • 保护应用程序 – 通过禁用调试、模糊处理托管代码、添加防调试和防篡改以及使用本机编译,阻止用户或攻击者对应用程序进行调试、篡改或反向工程 。Protect the Application – Prevent users or attackers from debugging, tampering, or reverse engineering the application by disabling debugging, obfuscating the managed code, adding anti-debug and anti-tamper, and using native compilation.

  • 设置打包属性 – 打包属性控制 Android 应用程序包 (APK) 的创建。Set Packaging Properties – Packaging properties control the creation of the Android application package (APK). 此步骤会优化 APK,保护其资产并根据需要模块化打包。This step optimizes the APK, protects its assets, and modularizes the packaging as needed.

  • 编译 – 此步骤编译代码和资产,以确认按发布模式生成。Compile – This step compiles the code and assets to verify that it builds in Release mode.

  • 存档以供发布 – 此步骤生成应用,并将其放置在存档中以供签名和发布 。Archive for Publishing – This step builds the app and places it in an archive for signing and publishing.

下面详细说明了上述各步骤。Each of these steps is described below in more detail.

指定应用程序图标Specify the Application Icon

强烈建议每个 Xamarin.Android 应用程序都指定一个应用程序图标。It is strongly recommended that each Xamarin.Android application specify an application icon. 某些应用程序市场将不允许发布没有图标的 Android 应用程序。Some application marketplaces will not allow an Android application to be published without one. Application 特性的 Icon 属性用于指定 Xamarin.Android 项目的应用程序图标。The Icon property of the Application attribute is used to specify the application icon for a Xamarin.Android project.

在 Visual Studio 2017 及更高版本中,可通过项目“属性”的“Android 清单”部分指定应用程序图标,如以下屏幕截图所示 :In Visual Studio 2017 and later, specify the application icon through the Android Manifest section of project Properties, as shown in the following screenshot:

设置应用程序图标Set the application icon

在这些示例中,@drawable/icon 指位于 Resources/drawable/icon.png (请注意,.png 扩展名不包含在资源名称中)中的一个图标文件。In these examples, @drawable/icon refers to an icon file that is located at Resources/drawable/icon.png (note that the .png extension is not included in the resource name). 另外,此属性也可在文件 Properties\AssemblyInfo.cs 中声明,如以下示例代码片段所示:This attribute can also be declared in the file Properties\AssemblyInfo.cs, as shown in this sample snippet:

[assembly: Application(Icon = "@drawable/icon")]

通常情况下,using Android.AppAssemblyInfo.csApplication 属性的命名空间为 Android.App)顶部声明;不过,可能需要添加此 using 语句(如果尚不存在)。Normally, using Android.App is declared at the top of AssemblyInfo.cs (the namespace of the Application attribute is Android.App); however, you may need to add this using statement if it is not already present.

应用程序版本控制Version the Application

对于 Android 应用程序维护和分发而言,版本控制很重要。Versioning is important for Android application maintenance and distribution. 如果没有版本控制,则很难确定应用程序是否应更新或如何更新。Without some sort of versioning in place, it is difficult to determine if or how an application should be updated. 为了辅助版本控制,Android 可识别两种不同类型的信息:To assist with versioning, Android recognizes two different types of information:

  • 版本号 – 表示应用程版本的整数值,供 Android 和应用程序内部使用。Version Number – An integer value (used internally by Android and the application) that represents the version of the application. 对大多数应用程序而言,此值的初始设置为 1,之后随每个内部版本递增。Most applications start out with this value set to 1, and then it is incremented with each build. 此值与版本名称属性(见下文)没有关系或关联。This value has no relationship or affinity with the version name attribute (see below). 应用程序和发布服务不应向用户显示此值。Applications and publishing services should not display this value to users. 此值在 AndroidManifest.xml 文件中存储为 android:versionCodeThis value is stored in the AndroidManifest.xml file as android:versionCode.

  • 版本名称 – 仅用于向用户传递应用程序(如安装在特定设备上)的版本相关信息的字符串。Version Name – A string that is used only for communicating information to the user about the version of the application (as installed on a specific device). 版本名称将向用户显示,或在 Google Play 中显示。The version name is intended to be displayed to users or in Google Play. 此字符串不供 Android 内部使用。This string is not used internally by Android. 版本名称可以是任何字符串值,它能帮助用户了解其设备上安装的版本。The version name can be any string value that would help a user identify the build that is installed on their device. 此值在 AndroidManifest.xml 文件中存储为 android:versionNameThis value is stored in the AndroidManifest.xml file as android:versionName.

在 Visual Studio 中,可在项目“属性” 的“Android 清单” 部分设置这些值,如以下屏幕截图所示:In Visual Studio, these values can be set in the Android Manifest section of project Properties, as shown in the following screenshot:

设置版本号Set the version number

缩小 APKShrink the APK

可通过结合使用 Xamarin.Android 链接器(删除不必要的托管 代码)和 Android SDK 中的 ProGuard 工具(删除未使用的 Java 字节码 )缩小 Xamarin.Android APK。Xamarin.Android APKs can be made smaller through a combination of the Xamarin.Android linker, which removes unnecessary managed code, and the ProGuard tool from the Android SDK, which removes unused Java bytecode. 生成过程首先使用 Xamarin.Android 链接器以托管代码 (C#) 级别优化应用,然后使用 ProGuard(如已启用)以 Java 字节码级别优化 APK。The build process first uses the Xamarin.Android linker to optimize the app at the managed code (C#) level, and then it later uses ProGuard (if enabled) to optimize the APK at the Java bytecode level.

配置链接器Configure the Linker

发布模式会关闭共享运行时并打开链接,使应用程序只提供运行时需要的 Xamarin.Android 部分。Release mode turns off the shared runtime and turns on linking so that the application only ships the pieces of Xamarin.Android required at runtime. Xamarin.Android 中的链接器使用静态分析来确定 Xamarin.Android 应用程序所使用或引用的程序集、类型和类型成员。The linker in Xamarin.Android uses static analysis to determine which assemblies, types, and type members are used or referenced by a Xamarin.Android application. 然后,链接器将放弃所有未使用(或引用)的程序集、类型和成员。The linker then discards all the unused assemblies, types, and members that are not used (or referenced). 这可显著减小包的大小。This can result in a significant reduction in the package size. 例如,HelloWorld 示例,其 APK 的最终大小减少了 83%:For example, consider the HelloWorld sample, which experiences an 83% reduction in the final size of its APK:

  • 配置:无 – Xamarin.Android 4.2.5 大小 = 17.4 MB。Configuration: None – Xamarin.Android 4.2.5 Size = 17.4 MB.

  • 配置:仅 SDK 程序集 – Xamarin.Android 4.2.5 大小 = 3.0 MB。Configuration: SDK Assemblies Only – Xamarin.Android 4.2.5 Size = 3.0 MB.

通过项目“属性” 的“Android 选项” 部分设置链接器选项:Set linker options through the Android Options section of the project Properties:

链接器选项Linker options

“链接” 下拉菜单提供以下选项,用于控制链接器:The Linking pull-down menu provides the following options for controlling the linker:

  • 无 – 这将关闭链接器;不会执行任何链接 。None – This turns off the linker; no linking will be performed.

  • 仅 SDK 程序集 – 这会仅链接 Xamarin.Android 所需的程序集。SDK Assemblies Only – This will only link the assemblies that are required by Xamarin.Android. 不会链接其他程序集。Other assemblies will not be linked.

  • SDK 和用户程序集 – 这会链接应用程序所需的所有程序集,而不是仅链接 Xamarin.Android 所需的程序集 。Sdk and User Assemblies – This will link all assemblies that are required by the application, and not just the ones required by Xamarin.Android.

链接可能产生一些意外的副作用,因此必须在物理设备上的发布模式下重新测试应用程序。Linking can produce some unintended side effects, so it is important that an application be re-tested in Release mode on a physical device.

ProGuardProGuard

ProGuard 是一种链接和模糊处理 Java 代码的 Android SDK 工具。ProGuard is an Android SDK tool that links and obfuscates Java code. ProGuard 通常用于创建小型应用程序,工作原理是减少 APK 中包含的大型库的内存占用。ProGuard is normally used to create smaller applications by reducing the footprint of large included libraries (such as Google Play Services) in your APK. ProGuard 将删除未使用的 Java 字节码,使生成的应用变得更小。ProGuard removes unused Java bytecode, which makes the resulting app smaller. 例如,在小型 Xamarin.Android 应用中使用 ProGuard 通常可减少约 24% 大小– 在具有多个库依赖关系的大型应用中使用 ProGuard 通常可实现更大幅度的大小缩减。For example, using ProGuard on small Xamarin.Android apps usually achieves about a 24% reduction in size – using ProGuard on larger apps with multiple library dependencies typically achieves an even greater size reduction.

ProGuard 不是 Xamarin.Android 链接器的替代工具。ProGuard is not an alternative to the Xamarin.Android linker. Xamarin.Android 链接器链接托管 代码,而 ProGuard 链接 Java 字节码。The Xamarin.Android linker links managed code, while ProGuard links Java bytecode. 生成过程首先在应用中使用 Xamarin.Android 链接器优化托管的 (C#) 代码,然后在 Java 字节码级别使用 ProGuard(若已启用)优化 APK。The build process first uses the Xamarin.Android linker to optimize the managed (C#) code in the app, and then it later uses ProGuard (if enabled) to optimize the APK at the Java bytecode level.

选择“启用 ProGuard”P时,Xamarin.Android 将在生成的 APK 中运行 ProGuard 工具。When Enable ProGuard is checked, Xamarin.Android runs the ProGuard tool on the resulting APK. ProGuard 配置文件由 ProGuard 在生成时生成和使用。A ProGuard configuration file is generated and used by ProGuard at build time. Xamarin.Android 还支持自定义 ProguardConfiguration 生成操作。Xamarin.Android also supports custom ProguardConfiguration build actions. 可以将自定义 ProGuard 配置文件添加到项目中,右键单击并选中该文件作为生成操作,如此示例中所示:You can add a custom ProGuard configuration file to your project, right-click it, and select it as a build action as shown in this example:

默认情况下,禁用 ProGuard。ProGuard is disabled by default. 仅在项目设置为“发布” 模式时才能使用“启用 ProGuard” 选项。The Enable ProGuard option is available only when the project is set to Release mode. 除非选中“启用 ProGuard” ,否则会忽略所有 ProGuard 生成操作。All ProGuard build actions are ignored unless Enable ProGuard is checked. Xamarin.Android ProGuard 配置不会模糊处理 APK,且不能启用模糊处理,即使处理自定义配置文件也不例外。The Xamarin.Android ProGuard configuration does not obfuscate the APK, and it is not possible to enable obfuscation, even with custom configuration files. 如果想要模糊处理,请参阅使用 Dotfuscator 保护应用程序If you wish to use obfuscation, please see Application Protection with Dotfuscator.

有关 ProGuard 工具用法的详细信息,请参阅 ProGuardFor more detailed information about using the ProGuard tool, see ProGuard.

保护应用程序Protect the Application

禁用调试Disable Debugging

在 Android 应用程序开发期间,将使用 Java 调试线路协议 (JDWP) 执行调试。During development of an Android application, debugging is performed with the use of the Java Debug Wire Protocol (JDWP). 这是一种技术,它允许 adb 等工具出于调试目的与 JVM 通信。This is a technology that allows tools such as adb to communicate with a JVM for the purposes of debugging. 默认对 Xamarin.Android 应用程序的调试版本启用 JDWP。JDWP is turned on by default for Debug builds of a Xamarin.Android application. 虽然 JDWP 在开发过程中很重要,但它会对已发布的应用程序造成安全问题。While JDWP is important during development, it can pose a security issue for released applications.

重要

请始终禁用已发布应用程序中的调试状态,因为如果不禁用此状态,则可能(通过 JDWP)获得 Java 进程的完全访问权限并在应用程序的上下文中执行任意代码。Always disable the debug state in a released application as it is possible (via JDWP) to gain full access to the Java process and execute arbitrary code in the context of the application if this debug state is not disabled.

Android 清单包含 android:debuggable 属性,该属性控制是否可以调试应用程序。The Android Manifest contains the android:debuggable attribute, which controls whether or not the application may be debugged. android:debuggable 属性设置为 false 被视为一种很好的做法。It is considered a good practice to set the android:debuggable attribute to false. 执行此操作最简单的方法是在 AssemblyInfo.cs 中添加条件编译语句:The simplest way to do this is by adding a conditional compile statement in AssemblyInfo.cs:

#if DEBUG
[assembly: Application(Debuggable=true)]
#else
[assembly: Application(Debuggable=false)]
#endif

注意,调试版本会自动设置某些权限以简化调试(如 InternetReadExternalStorage)。Note that Debug builds automatically set some permissions to make debug easier (such as Internet and ReadExternalStorage). 但是,发布版本只使用显式配置的权限。Release builds, however, use only the permissions that you explicitly configure. 若发现切换到发布版本会导致应用失去可在调试版本中使用的权限,请验证是否已在“所需权限” 列表中显式启用了此权限,如权限中所述。If you find that switching to the Release build causes your app to lose a permission that was available in the Debug build, verify that you have explicitly enabled this permission in the Required permissions list as described in Permissions.

使用 Dotfuscator 保护应用程序Application Protection with Dotfuscator

即使已禁用调试,攻击者仍可能重新打包应用程序,从而添加或删除配置选项或权限。Even with debugging disabled, it is still possible for attackers to re-package an application, adding or removing configuration options or permissions. 这可使他们对应用程序进行反向工程、调试或篡改。This allows them to reverse-engineer, debug, or tamper with the application. Dotfuscator Community Edition (CE) 可用于混淆托管代码,并在生成时向 Xamarin.Android 应用插入运行时安全状态检测代码,对应用是否在根设备上运行进行检测和响应。Dotfuscator Community Edition (CE) can be used to obfuscate managed code and inject runtime security state detection code into a Xamarin.Android app at build time to detect and respond if the app is running on a rooted device.

Visual Studio 2017 附带了 Dotfuscator CE。Dotfuscator CE is included with Visual Studio 2017. 若要使用 Dotfuscator,请单击“工具”>“PreEmptive Protection - Dotfuscator” 。To use Dotfuscator, click Tools > PreEmptive Protection - Dotfuscator.

若要配置 Dotfuscator CE,请参阅 Using Dotfuscator Community Edition with Xamarin(结合使用 Dotfuscator Community Edition 和 Xamarin)。To configure Dotfuscator CE, please see Using Dotfuscator Community Edition with Xamarin. 完成配置后,Dotfuscator CE 将自动保护创建的每个生成。Once it is configured, Dotfuscator CE will automatically protect each build that is created.

将程序集捆绑到本机代码Bundle Assemblies into Native Code

此选项启用时,程序集会捆绑到本机共享库中。When this option is enabled, assemblies are bundled into a native shared library. 此选项使代码保持安全;它通过在本机二进制文件中嵌入这些托管程序集来保护它们。This option keeps the code safe; it protects managed assemblies by embedding them in native binaries.

此选项需要 Enterprise 许可证,仅当“使用快速部署” 禁用时才可用。This option requires an Enterprise license and is only available when Use Fast Deployment is disabled. “将程序集捆绑到本机代码” 在默认情况下处于禁用状态。Bundle assemblies into native code is disabled by default.

请注意,“捆绑到本机代码” 选项执行不 意味着程序集会编译到本机代码中。Note that the Bundle into Native Code option does not mean that the assemblies are compiled into native code. 无法使用 AOT 编译将程序集编译到本机代码中(当前只是试验性功能,不用于生产用途)。It is not possible to use AOT Compilation to compile assemblies into native code (currently only an experimental feature, and not for production use).

AOT 编译AOT Compilation

打包属性页上的AOT 编译选项支持预先编译程序集。The AOT Compilation option (on the Packaging Properties page) enables Ahead-of-Time (AOT) compilation of assemblies. 启用此选项后,通过在运行时之前预编译程序集可将实时 (JIT) 启动开销降到最低。When this option is enabled, Just In Time (JIT) startup overhead is minimized by precompiling assemblies before runtime. 生成的本机代码包括在 APK 以及未编译程序集中。The resulting native code is included in the APK along with the uncompiled assemblies. 这可缩短应用程序启动时间,但代价是 APK 大小会变得稍大。This results in shorter application startup time, but at the expense of slightly larger APK sizes.

“AOT 编译” 选项要求使用 Enterprise 或更高版本的许可证。The AOT Compilation option requires an Enterprise license or higher. 仅在项目配置为发布模式时,才可使用“AOT 编译” ,并且该选项默认处于禁用状态。AOT compilation is available only when the project is configured for Release mode, and it is disabled by default. 有关 AOT 编译的详细信息,请参阅 AOTFor more information about AOT Compilation, see AOT.

LLVM 优化编译器LLVM Optimizing Compiler

LLVM 优化编译器 会创建更小更快速的编译代码,并将 AOT 编译的程序集转换为本机代码,但生成时间会变缓慢。The LLVM Optimizing Compiler will create smaller and faster compiled code and convert AOT-compiled assemblies into native code, but at the expense of slower build times. 默认情况下,LLVM 编译器处于禁用状态。The LLVM compiler is disabled by default. 要使用 LLVM 编译器,必须首先启用“AOT 编译”选项(在打包属性页面上) 。To use the LLVM compiler, the AOT Compilation option must first be enabled (on the Packaging Properties page).

备注

“LLVM 优化编译器” 选项需要企业许可证。The LLVM Optimizing Compiler option requires an Enterprise license.

设置打包属性Set Packaging Properties

可在项目“属性” 的“Android 选项” 部分设置打包属性,如以下屏幕截图所示:Packaging properties can be set in the Android Options section of project Properties, as shown in the following screenshot:

打包属性Packaging Properties

其中许多属性(例如“使用共享运行时” 和“使用快速部署” )专用于调试模式。Many of these properties, such as Use Shared Runtime, and Use Fast Deployment are intended for Debug mode. 但是,在发布模式下配置应用程序时,还需要进行其他设置,这些设置用于确定如何针对大小和执行速度优化应用、如何防止篡改应用,以及如何打包应用以支持不同的体系结构和大小限制。However, when the application is configured for Release mode, there are other settings that determine how the app is optimized for size and execution speed, how it is protected from tampering, and how it can be packaged to support different architectures and size restrictions.

指定支持的体系结构Specify Supported Architectures

准备 Xamarin.Android 应用进行发布时,必须指定支持的 CPU 体系结构。When preparing a Xamarin.Android app for release, it is necessary to specify the CPU architectures that are supported. 单个 APK 可包含计算机代码,以支持多个不同的体系结构。A single APK can contain machine code to support multiple, different architectures. 请参阅 CPU 体系结构,深入了解如何支持多个 CPU 体系结构。See CPU Architectures for details about supporting multiple CPU architectures.

每个选定 ABI 生成一个包 (.APK)Generate One Package (.APK) per Selected ABI

启用此选项后,会为每个支持的 ABI(在“高级” 选项卡上进行选择,如 CPU 体系结构中所述)分别创建一个 APK,而不是为所有支持的 ABI 创建单个大型 APK。When this option is enabled, one APK will be created for each of the supported ABI's (selected on the Advanced tab, as described in CPU Architectures) rather than a single, large APK for all supported ABI's. 仅在项目配置为用于发布模式时,才可使用此选项,并且其默认处于禁用状态。This option is available only when the project is configured for Release mode, and it is disabled by default.

Multi-DexMulti-Dex

如果启用“启用 Multi-Dex” 选项,Android SDK 工具将用于绕过 .dex 文件格式的 65K 方法限制。When the Enable Multi-Dex option is enabled, Android SDK tools are used to bypass the 65K method limit of the .dex file format. 65K 方法限制基于应用_引用_的 Java 方法数(包括应用依赖的任何库中的方法数)– 不基于_源代码中写入_的方法数。The 65K method limitation is based on the number of Java methods that an app references (including those in any libraries that the app depends on) – it is not based on the number of methods that are written in the source code. 如果应用程序只定义了几个方法,却使用了多个方法或大型库,则可能超出 65K 限制。If an application only defines a few methods but uses many (or large libraries), it is possible that the 65K limit will be exceeded.

应用可能未使用每个引用库中的每个方法;因此,ProGuard(见上文)等工具可能会将未使用的方法从代码中删除。It is possible that an app is not using every method in every library that is referenced; therefore, it is possible that a tool such as ProGuard (see above) can remove the unused methods from code. 最佳做法是仅在绝对必要时启用“启用 Multi-Dex” ,也就是说,即使使用 ProGuard,应用引用的 Java 方法仍然超过 65K。The best practice is to enable Enable Multi-Dex only if absolutely necessary, i.e.the app still references more than 65K Java methods even after using ProGuard.

若要深入了解 Multi-Dex,请参阅配置超出 64K 方法的应用For more information about Multi-Dex, see Configure Apps with Over 64K Methods.

CompileCompile

完成上述所有步骤后,应用即可用于编译。After all of the above steps are completed, the app is ready for compilation. 选择“生成”>“重新生成解决方案” 以验证其是否在发布模式下成功生成。Select Build > Rebuild Solution to verify that it builds successfully in Release mode. 请注意,此步骤尚不会产生 APK。Note that this step does not yet produce an APK.

对应用包进行签名中更详细地讨论了打包和签名。Signing the App Package discusses packaging and signing in more detail.

存档以供发布Archive for Publishing

若要开始发布过程,请在解决方案资源管理器中右键单击项目,然后选择“存档...” 上下文菜单项:To begin the publishing process, right-click the project in Solution Explorer and select the Archive... context menu item:

存档应用Archive app

选择“存档...” 选项将启动存档管理器并开始应用程序包的存档过程,如以下屏幕截图所示:Archive... launches the Archive Manager and begins the process of archiving the App bundle as shown in this screenshot:

存档管理器Archive Manager

另一种创建存档的方法是:在解决方案资源管理器中,右键单击“解决方案”,然后选择“全部存档...” ,这会生成解决方案并存档可生成存档的所有 Xamarin 项目:Another way to create an archive is to right-click the Solution in the Solution Explorer and select Archive All..., which builds the solution and archives all Xamarin projects that can generate an archive:

全部存档Archive All

“存档” 和“全部存档” 均会自动启动存档管理器Both Archive and Archive All automatically launch the Archive Manager. 若要直接启动存档管理器,请单击“工具”>“存档管理器...” 菜单项:To launch the Archive Manager directly, click the Tools > Archive Manager... menu item:

启动存档管理器Launch Archive Manager

右键单击“解决方案” 节点并选择“查看存档” 可随时查看该解决方案的存档:The solution's archives at any time by right clicking the Solution node and selecting View Archives:

查看存档View Archives

存档管理器The Archive Manager

存档管理器由“解决方案列表” 窗格、“存档列表” 和“详细信息面板” 组成:The Archive Manager is comprised of a Solution List pane, an Archives List, and a Details Panel:

“存档管理器”窗格Archive Manager Panes

“解决方案列表” 将显示所有解决方案,其中至少有一个项目已存档。The Solution List displays all solutions having at least one archived project. “解决方案列表” 包括以下各部分:The Solution List includes the following sections:

  • 当前解决方案 – 显示当前的解决方案。Current Solution – Displays the current solution. 请注意,如果当前解决方案不含现有存档,此区域可能为空。Note that this area may be empty if the current solution does not have an existing archive.
  • 全部存档 – 显示包含存档的所有解决方案。All Archives – Displays all solutions that have an archive.
  • 搜索文本框(顶部)– 根据文本框中输入的搜索字符串筛选“全部存档” 列表中列出的解决方案。Search text box (at the top) – Filters the solutions listed in the All Archives list according to the search string entered in the text box.

“存档列表” 显示有关所选解决方案的所有存档的列表。The Archives List displays the list of all archives for the selected solution. “存档列表” 包括以下各部分:The Archives List includes the following sections:

  • 所选解决方案名称 – 显示“解决方案列表” 中所选解决方案的名称。Selected solution name – Displays the name of the solution selected in the Solution List. “存档列表” 中显示的所有信息均与此选定的解决方案有关。All information shown in the Archives List refers to this selected solution.
  • 平台筛选器 – 此字段可按平台类型(如 iOS 或 Android)筛选存档。Platforms Filter – This field makes it possible to filter archives by platform type (such as iOS or Android).
  • 存档项目 – 选定解决方案的存档列表。Archive Items – List of archives for the selected solution. 此列表中的每个项均包括项目名称、创建日期和平台。Each item in this list includes the project name, creation date, and platform. 还可以显示其他信息,例如存档或发布项目时的进度。It can also show additional information such as the progress when an item is being archived or published.

“详细信息面板” 显示有关每个存档的其他信息。The Details Panel displays additional information about each archive. 用户还可以从此面板启动分发工作流或打开创建分发的文件夹。It also allows the user to start the Distribution workflow or open the folder where the distribution has been created. “生成注释” 部分可将生成注释包括在存档中。The Build Comments section makes it possible to include build comments in the archive.

分布Distribution

准备好发布存档版应用程序后,请在“存档管理器” 中选择该存档,然后单击“分发...” 按钮:When an archived version of the application is ready to publish, select the archive in the Archive Manager and click the Distribute... button:

“分发”按钮Distribute button

“分发通道” 对话框包括以下方面的信息:应用、分发工作流进度指示以及分发渠道选项。The Distribution Channel dialog shows information about the app, an indication of distribution workflow progress, and a choice of distribution channels. 首次运行时,提供两个选项:On the first run, two choices are presented:

选择分发通道Select Distribution Channel

可选择以下分发通道之一:It is possible to choose one of the following distribution channels:

  • Ad-Hoc – 将已签名的 APK 保存到磁盘,以将其旁加载到 Android 设备。Ad-Hoc – Saves a signed APK to disk that can be sideloaded to Android devices. 继续查看对应用包进行签名,了解如何创建 Android 签名标识、为 Android 应用程序创建新的签名证书以及将“临时”版本的应用发布到磁盘 。Continue to Signing the App Package to learn how to create an Android signing identity, create a new signing certificate for Android applications, and publish an ad hoc version of the app to disk. 这是为测试创建 APK 的好方法。This is a good way to create an APK for testing.

  • Google Play – 将已签名的 APK 发布到 Google Play。Google Play – Publishes a signed APK to Google Play. 继续查看发布到 Google Play,了解如何对 APK 进行签名并将其发布到 Google Play 商店。Continue to Publishing to Google Play to learn how to sign and publish an APK in the Google Play store.