内部分发

了解 EAS Build 如何为你的构建提供可与你的团队共享的 URL,以便进行内部分发。


使用 EAS Build 设置内部分发构建只需几分钟,并提供了一种简化的方式,让你可以将应用与团队和其他测试人员共享以获取反馈。它通过提供一个 URL,使他们能够直接将应用安装到设备上。如果你尚不确定是否要使用这种方法,并且想了解用于内部分发应用的所有可用选项,请参阅应用分发审核概览指南。

🌐 Setting up an internal distribution build only takes a few minutes with EAS Build and provides a streamlined way to share your app with your team and other testers for feedback. It does this by providing a URL that allows them to install the app directly to their device. If you are not sure yet if you want to use this approach and want to learn about all of the options available for distributing your app internally, refer to the overview of distribution apps for review guide.

使用内部分发

🌐 Using internal distribution

要为内部分发配置构建配置文件,请在其上设置 "distribution": "internal"。当你设置此配置时,它会对构建配置文件产生以下影响:

🌐 To configure a build profile for internal distribution, set "distribution": "internal" on it. When you set this configuration, it has the following effects on the build profile:

  • AndroidgradleCommand 的默认行为将更改为生成 APK 而不是 AAB。如果你指定了自定义的 gradleCommand,请确保它生成 APK,否则无法直接安装到 Android 设备上。此外,EAS Build 将生成一个新的 Android 签名密钥库来签署 APK,如果包名与你的开发构建相同,则会使用现有密钥库。
  • iOS:使用此配置文件构建的应用将使用Ad Hoc 或企业配置。在使用 Ad Hoc 配置时,EAS Build 会生成一个包含设备 UDID 允许列表的配置文件,只有构建时列表中的设备才能安装它。你可以通过运行 eas device:create 创建新构建来添加设备。
  • 默认情况下,内部分发构建的 URL 对任何拥有该 URL 的人都是可用的,每个 URL 都由 32 个字符的 UUID 标识。如果你希望访问这些构建时需要登录到授权的 Expo 账户,可以在你的 项目设置 中禁用 对内部构建的未认证访问 选项。

有关如何配置、创建和安装构建的更多信息,请参阅下面有关使用 EAS Build 进行内部分发的教程:

🌐 See the tutorial on Internal distribution with EAS Build below for more information on how to configure, create, and install a build:

创建并共享内部发行版本

使用 EAS Build 设置和共享内部分发构建的完整分步指南。

CI 自动化(可选)

🌐 Automation on CI (optional)

可以使用 --non-interactive 标志在 CI 中以非交互方式运行内部分发构建。然而,如果你在 iOS 上使用临时配置(ad hoc provisioning),则无法在使用此标志时将新设备添加到你的配置文件中。在通过 eas device:create 注册设备后,你需要以交互方式运行 eas build 并使用 Apple 进行身份验证,以便 EAS 将设备添加到你的配置文件中。了解更多关于从 CI 触发构建的信息

🌐 It's possible to run internal distribution builds non-interactively in CI using the --non-interactive flag. However, if you are using ad hoc provisioning on iOS you will not be able to add new devices to your provisioning profile when using this flag. After registering a device through eas device:create, you need to run eas build interactively and authenticate with Apple in order for EAS to add the device to your provisioning profile. Learn more about triggering builds from CI.

管理设备

🌐 Managing devices

你可以通过运行以下命令查看通过 eas device:create 注册的任何设备:

🌐 You can see any devices registered via eas device:create by running:

Terminal
# List devices registered for ad hoc provisioning
eas device:list

通过 Expo 为临时分发注册的设备,在使用 EAS Build 为新的内部构建生成配置描述文件,或使用 eas build:resign 对现有构建进行重新签名 后,将会出现在你的 Apple 开发者门户中。

🌐 Devices registered with Expo for ad hoc provisioning will appear on your Apple Developer Portal after they are used to generate a provisioning profile for a new internal build with EAS Build or to resign an existing build with eas build:resign.

删除设备

🌐 Remove devices

如果不再使用某个设备,可以通过运行以下命令将其从该列表中删除:

🌐 If a device is no longer in use, it can be removed from this list by running:

Terminal
# Delete devices from your Expo account, optionally disable them on the Apple Developer Portal
eas device:delete

This command will also prompt you to disable the device on the Apple Developer Portal. Disabled devices still count against Apple's limit of 100 devices for ad hoc distribution per app.

重命名设备

🌐 Rename devices

通过网站 URL/二维码添加的设备在选择用于 EAS 构建时默认会显示其 UDID。你可以使用以下命令为设备分配友好名称:

🌐 Devices added via the website URL/QR code will default to displaying their UDID when selecting them for an EAS Build. You can assign friendly names to your devices with the following command:

Terminal
# Rename devices on Expo and the Apple Developer Portal
eas device:rename

分发机制概述

🌐 Overview of distribution mechanisms

以下是将你的应用分发到内部分发支持的设备的不同机制。

🌐 The following are the different mechanisms for distributing your app to devices supported by internal distribution.

Android:构建并分发 APK

要将你的应用分享至安卓设备,你必须构建项目的 APK(Android 应用包文件)。APK 可以直接通过 USB 安装到安卓设备上,或者通过网络下载文件,或通过电子邮件或聊天应用发送给用户,一旦用户接受了安装未通过 Play 商店审核的应用的安全警告即可安装。你的应用的 AAB(Android 应用包)二进制文件必须通过 Play 商店分发。

🌐 To share your app to Android devices, you must build an APK (Android application package file) of your project. APKs can be installed directly to an Android device over USB, by downloading the file over the web or through an email or chat app, once the user accepts the security warning for installing an app that has not gone through Play Store review. AAB (Android app bundle) binaries of your app must be distributed through the Play Store.

iOS:Ad Hoc 分发

苹果提供临时配置文件来将你的应用分发到已注册到你的 Apple 开发者账户的测试设备。此方法需要付费的 Apple 开发者账户,而且该账户每年最多只能使用此方法分发给 100 部 iPhone。

🌐 Apple offers ad hoc provisioning profiles to distribute your app to test devices once they have been registered to your Apple Developer account. This method requires a paid Apple Developer account and that account will only be able to use this method to distribute to at most 100 iPhones per year.

你需要知道每个将安装你的应用的设备的 UDID(唯一设备标识符),如果你尝试与非开发者分享,这可能会有些困难。添加新设备将需要重新构建你的应用或使用新证书重新签名该构建

🌐 You will need to know the UDID (Unique Device Identifier) of each device that will install your app, which may be challenging if you try to share with someone who is not a developer. Adding a new device will require a rebuild of your app or re-signing the build with new credentials.

如果你以前没有做过,正确设置 Ad Hoc 证书可能会让人望而生畏,即使你做过,也可能觉得繁琐。如果你使用的是 EAS Build,它针对 Expo 和 React Native 项目进行了优化,我们将为你处理设置 Ad Hoc 凭证时耗时的部分。

🌐 Setting up Ad Hoc certificates correctly can be intimidating if you haven't done it before and tedious even if you have. If you're using EAS Build, which is optimized for Expo and React Native projects, we'll handle the time-consuming parts of setting up Ad Hoc credentials for you.

iOS:企业分发

如果你的应用仅供大型组织的员工内部使用,并且无法通过 App Store 分发,则应使用企业分发。与临时分发不同,企业分发允许安装你应用的设备数量无限制,且无需管理每个设备的 UDID。通常,这些应用会通过移动设备管理(MDM)解决方案分发给终端用户。企业分发需要加入 Apple Developer Enterprise Program 会员。加入企业计划的组织必须满足超出 App Store 分发要求的额外条件。

🌐 If your app is only intended for internal use by employees of a large organization and cannot be distributed through the App Store, you should use Enterprise distribution. Unlike with Ad Hoc Distribution, the number of devices that can install your app is unlimited, and you do not need to manage each device's UDID. Often these apps will be distributed to end users through a mobile device management (MDM) solution. Enterprise Distribution requires membership in the Apple Developer Enterprise Program. Organizations joining the Enterprise Program must meet additional requirements beyond what is required for App Store distribution.