This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

创建并共享内部发行版本

了解内部分发构建、我们为什么需要它们以及如何创建它们。


在本章中,我们将学习如何设置内部分发构建

🌐 In this chapter, we'll learn how to set up internal distribution builds.

观看:如何创建和分享内部分发版本
观看:如何创建和分享内部分发版本

使用 EAS 创建内部分发构建,并直接与你的团队分享进行测试。


内部分布构建

🌐 Internal distribution build

内部分发版本非常适合与团队成员共享更新,使技术和非技术相关人员都能直接提供反馈。与开发版本不同,这些版本无需运行开发服务器,从而简化了测试流程。

🌐 Internal distribution builds are ideal for sharing updates with team members, allowing both technical and non-technical stakeholders to provide feedback directly. Unlike development builds, these do not require running a development server, simplifying the testing process.

内部分发应用的方法

🌐 Ways to distribute an app internally

Google 和 Apple 都提供了内部共享应用的内置机制:

🌐 Both Google and Apple provide built-in mechanisms for sharing apps internally:

  • 安卓:使用 Google Play 测试版
  • iOS:使用TestFlight

然而,这两种传统方法都有其局限性。例如,TestFlight 一次只允许一个活动版本。

🌐 However, both of these traditional methods have their limitations. For example, TestFlight limits to one active build at a time.

EAS Build 加快分发速度

🌐 EAS Build for faster distribution

EAS Build 加快了这一过程。它为我们的构建创建了可分享的链接,并提供了使用说明。它具有默认配置,旨在便于内部分发,提供了一种比传统方法更高效的替代方案。

🌐 EAS Build speeds up the process. It creates shareable links for our builds and provides instructions on using them. It has a default configuration designed to facilitate internal distribution, offering a more efficient alternative to traditional methods.

创建内部分发版本

🌐 Create an internal distribution build

要使用 EAS Build 创建和分发构建,我们需要执行以下步骤:

🌐 To create and distribute a build with EAS Build, we need to follow these steps:

1

配置预览构建配置文件

🌐 Configure preview build profile

在我们最初的 eas.json 设置中,我们已经有一个默认配置,其中包括一个用于内部分发的 preview 构建配置文件:

🌐 From our initial setup in eas.json, we already have a default configuration that includes a preview build profile designed for internal distribution:

eas.json
{ "build": { "preview": { "distribution": "internal" } } }

这就是我们创建第一个内部分发构建所需的一切。上面代码片段中的 preview 构建配置文件有一个 distribution 属性,其值设置为 internal。该值允许我们与任何人共享构建 URL,这样他们就可以在自己的设备上安装应用,而无需开发服务器来运行应用。

🌐 This is all we need to create our first internal distribution build. The preview build profile from the above snippet has a distribution property whose value is set to internal. This value allows us to share our build URLs with anyone so they can install it on their device and do not require a development server to run the app.

如前几章所述,对于非应用商店构建,Android 需要 .apk 格式,iOS 需要 .ipa 格式。这同样适用于内部分发的构建。当 distribution 设置为 internal 时,会自动为设备创建这些格式的应用二进制文件。

🌐 As discussed in the previous chapters, for non-app store builds, Android requires .apk and iOS needs .ipa formats. This applies to internal distribution builds as well. The distribution when set to internal, automatically creates the app binary in these file formats for devices.

2

创建

🌐 Create

创建内部分发版本需要应用签名凭证

🌐 Creating an internal distribution build requires app signing credentials.

Android 应用签名没有限制,允许安装任何兼容的 .apk 文件。当创建开发版本时,会为其生成一个新的 Android 密钥库。因此,预览版本无需生成新的密钥库。

🌐 Android app signing is non-restrictive and allows installing any compatible .apk file. When a development build was created, a new Android Keystore was generated for it. Hence, there is no need to generate a new keystore for preview builds.

另一方面,苹果对在 iOS 设备上分发应用有更严格的规定。我们需要一个明确列出允许运行该应用的设备的临时配置文件。一些符合特定要求的组织,可能能够使用 Apple Developer Enterprise Program 在内部将应用分发给更大的受众。

🌐 On the other hand, Apple has stricter rules for app distribution on iOS devices. We need an ad hoc provisioning profile that explicitly lists the devices allowed to run the app. Some organizations whose apps meet specific requirements may be able to use the Apple Developer Enterprise Program to distribute apps internally to a larger audience.

  • 使用 preview 配置文件来启动 Android 构建:
Terminal
eas build --platform android --profile preview
  • 此命令会触发 EAS 构建,在 EAS 仪表板上,我们可以看到构建的进度:

3

安装

🌐 Install

构建完成后,构建产物部分会更新,表示构建已完成。此部分提供在 iOS 设备上运行开发构建的可用方法:Expo Orbit 和安装按钮。

🌐 Once the build finishes, the Build artifact section gets updated, indicating that the build is complete. This section provides the methods available for running the development build on an iOS device: Expo Orbit and Install button.

  • 打开构建的详细信息页面。如果你要与他人分享该构建,可以将构建的链接发送给他们。他们将能够打开构建的详细信息页面或包含 Expo Orbit 的构建产物详情。
  • 使用 USB 将 Android 或 iOS 设备连接到你的电脑。
  • 打开 Orbit 菜单栏应用。
  • 在 Orbit 应用中选择 设备
  • 构建生成物下,点击用 Orbit 打开
备用:使用安装和二维码
  • 打开构建的详细页面。如果你要与他人共享该构建,可以将构建页面的链接发送给他们。他们将能够打开链接并查看构建工件的详细信息,其中包括 Expo Orbit。
  • 在“构建产物”部分下点击安装以显示在测试设备上安装弹出窗口。
  • 发送链接到设备 部分复制链接,并将其发送到测试设备。

4

运行

🌐 Run

在你的设备上点击应用图标即可启动预览版本,无需开发服务器。

🌐 Tap the app icon on your device to start the preview build. There is no need for a development server.

由于我们已经设置了多个应用版本,因此可以在我们的设备上分别看到开发版本和预览版本已安装。例如:

🌐 Since we have already set up multiple app variants, we can see both the development and preview variants installed separately on our devices. For example:

  • 在安卓上:
  • 在 iOS 上:

概括

🌐 Summary

Chapter 6: Create and share internal distribution build

我们成功创建了用于 Android 和 iOS 的内部分发版本,iOS 使用了临时配置,并在同一设备上安装了多个应用变体。

在下一章中,了解面向开发者和面向用户的应用版本以及如何自动管理它们。

下一个:管理不同的应用版本