内部分发
了解 EAS Build 如何为你的构建提供可与你的团队共享的 URL,以便进行内部分发。
使用 EAS Build 只需几分钟即可设置内部分发版本,并提供一种简化的方式,以便与你的团队和其他测试人员共享你的应用以获取反馈。它通过提供一个 URL 来实现此目的,该 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:
-
安卓:
gradleCommand
的默认行为将更改为生成 APK 而不是 AAB。如果你指定了自定义gradleCommand
,请确保它也指定了 生成 APK,否则它将无法直接安装在 Android 设备上。此外,EAS Build 将生成一个新的 Android 密钥库用于对 APK 进行签名,如果软件包名称与你的 开发构建 相同,它将使用现有的密钥库。¥Android: The default behavior for the
gradleCommand
will change to generate an APK instead of an AAB. If you have specified a customgradleCommand
, then make sure that it produces an APK, or it won't be directly installable on an Android device. Additionally, EAS Build will generate a new Android keystore for signing the APK, or it will use an existing one if the package name is the same as your development build. -
iOS:使用此配置文件的构建将使用 临时或企业级配置。使用临时配置时,EAS Build 将生成一个包含设备 UDID 允许列表的配置文件,并且只有在构建时列表中的设备才能安装它。你可以通过运行
eas device:create
并创建新版本来添加设备。¥iOS: Builds using this profile will use either ad hoc or enterprise provisioning. When using ad hoc provisioning, EAS Build will generate a provisioning profile containing an allow-list of device UDIDs, and only those devices in the list at build time will be able to install it. You can add a device by running
eas device:create
and creating a new build. -
默认情况下,任何拥有 URL 的人都可以访问内部分发构建 URL,每个 URL 都由一个 32 个字符的 UUID 标识。如果你希望要求登录授权的 Expo 账户才能访问这些构建,你可以在 项目设置 中禁用“未经身份验证访问内部构建”选项。
¥By default, internal distribution build URLs are available to anybody with the URL, and each is identified by a 32 character UUID. If you would like to require sign-in to an authorized Expo account to access these builds, you can disable the Unauthenticated access to internal builds option in your project settings.
有关如何配置、创建和安装构建的更多信息,请参阅下面有关使用 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 上使用临时配置,则使用此标志时将无法将新设备添加到你的配置文件中。通过 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:
# 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:
# Delete devices from your Expo account, optionally disable them on the Apple Developer Portal
-
eas device:delete
此命令还会提示你在 Apple 开发者门户上禁用该设备。对于每个应用的临时分发,已禁用的设备仍计入 Apple 的设备数量限制为 100 台。
¥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/QR 代码添加的设备在选择 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:
# 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: Build and distribute an APK
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 distribution
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.
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.
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: Enterprise distribution
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.