自动提交

了解如何使用 EAS Build 启用自动提交。


许多移动部署流程最终发展到这样的程度:一旦完成适当的构建,应用就会自动提交到相应的商店。这使开发者不必等待构建完成,避免了一些手动工作,并且无需协调向团队提供应用商店凭据。

¥Many mobile deployment processes eventually evolve to the point where the app is automatically submitted to the respective store once an appropriate build is completed. This saves developers from having to wait around for the build to complete, avoids a bit of manual work, and eliminates the need to coordinate providing app store credentials to the team.

EAS Build 为你提供带有 --auto-submit 标志的开箱即用的自动提交。该标志告诉 EAS Build 在完成后将构建传递给 EAS Submit,并提供适当的提交配置文件。有关如何设置和配置提交的更多信息,请参阅 EAS 提交文件

¥EAS Build gives you automatic submissions out of the box with the --auto-submit flag. This flag tells EAS Build to pass the build along to EAS Submit with the appropriate submission profile upon completion. Refer to the EAS Submit documentation for more information on how to set up and configure submissions.

当你运行 eas build --auto-submit 时,你将获得一个提交详细信息页面的链接,你可以在其中跟踪提交的进度。你还可以随时在 你项目的提交仪表板 上找到此页面,它是从你的构建详细信息页面链接的。

¥When you run eas build --auto-submit you will be provided with a link to a submission details page, where you can track the progress of the submission. You can also find this page at any time on the submissions dashboard for your project, and it is linked from your build details page.

选择提交配置文件

¥Selecting a submission profile

默认情况下,--auto-submit 将尝试使用与所选构建配置文件同名的提交配置文件。如果该配置文件不存在,或者你希望使用不同的配置文件,则可以使用 --auto-submit-with-profile=<profile-name>

¥By default, --auto-submit will try to use a submission profile with the same name as the selected build profile. If this does not exist, or if you prefer to use a different profile, you can use --auto-submit-with-profile=<profile-name> instead.

构建配置文件环境变量并提交

¥Build profile environment variables and submissions

运行 eas build --profile <profile-name> --auto-submit 时,将使用与构建配置文件 <profile-name> 关联的任何环境变量来评估项目的 app.config.js。例如,假设我们使用以下配置运行 eas build -p ios --profile production --auto-submit

¥When running eas build --profile <profile-name> --auto-submit, the project's app.config.js will be evaluated using any environment variables associated with the build profile <profile-name>. For example, suppose we ran eas build -p ios --profile production --auto-submit with the following configuration:

eas.json
{ "build": { "production": { "env": { "APP_ENV": "production" } }, "development": { "env": { "APP_ENV": "development" } } } }
app.config.js
export default () => { return { name: process.env.APP_ENV === 'production' ? 'My App' : 'My App (DEV)', ios: { bundleIdentifier: process.env.APP_ENV === 'production' ? 'com.my.app' : 'com.my.app-dev', }, // ... other config here }; };

在评估提交的 app.config.js 时,将使用 production 配置文件中的 APP_ENV 变量,因此名称将为 My App,包标识符将为 com.my.app

¥The APP_ENV variable from the production profile will be used when evaluating app.config.js for the submission, and therefore the name will be My App and the bundle identifier will be com.my.app.

应用商店的默认提交行为

¥Default submission behavior for app stores

默认情况下,--auto-submit 标志将使你的构建可用于内部测试,但不会自动提交你的应用进行公开发布审核。以下部分描述了 Android 和 iOS 的默认提交行为。

¥By default, the --auto-submit flag will make your build available for internal testing, but will not automatically submit your app to review for public distribution. Sections below describe the default submission behavior for Android and iOS.

Android 提交

¥Android submissions

对于 Android,如果未提供足够的元数据,则默认行为是为新应用创建内部版本。要控制版本的提交位置和方式,你可以在 eas.json 提交配置文件中指定 releaseStatustrack 字段:

¥For Android, if sufficient metadata is not provided, the default behavior is to create an internal release for new apps. To control where and how your build is submitted, you can specify the releaseStatus and track fields in your eas.json submission profile:

发布状态选项:

¥Release status options:

  • draft:创建需要在 Google Play 管理中心手动推广的草稿版本

    ¥draft: Creates a draft release that requires manual promotion in the Google Play Console

  • completed:立即向指定轨道上的用户发布

    ¥completed: Immediately releases to users on the specified track

  • inProgress:分阶段发布(与 rollout 百分比配合使用)

    ¥inProgress: Staged rollout release (use with rollout percentage)

  • halted:暂停发布

    ¥halted: Halted release

当你在 eas.json 中为提交配置文件明确设置轨道时,--auto-submit 标志会将构建提交到所选轨道。这还需要将 releaseStatus 设置为 completed

¥When you explicitly set a track to your submission profile in eas.json, the --auto-submit flag will submit the build to the chosen track. This also requires the releaseStatus to be set to completed:

轨道选项:

¥Track options:

  • internal:内部测试轨道(最多 100 名测试人员)(默认)

    ¥internal: Internal testing track (up to 100 testers) (default)

  • alpha:封闭测试轨道

    ¥alpha: Closed testing track

  • beta:开放测试轨道

    ¥beta: Open testing track

  • production:生产轨道(公开发布)

    ¥production: Production track (public release)

iOS 提交

¥iOS submissions

对于 iOS,默认提交行为是将构建提交到 TestFlight,但不提交到 App Store 审核。这意味着:

¥For iOS, the default submission behavior is to submit the build to TestFlight, but not for App Store review. This means:

  • 构建版本已提交至 TestFlight 并可供内部测试。

    ¥The build is submitted to TestFlight and becomes available for internal testing.

  • 如果你已在 App Store Connect 中启用 "启用自动分发",TestFlight 将自动创建一个组并邀请所有内部 TestFlight 用户测试版本。

    ¥If you have "Enable automatic distribution" turned on in App Store Connect, TestFlight will automatically create a group and invite all your internal TestFlight users to test the build.

  • 你还可以使用 eas.json 提交配置文件中的 groups 字段指定其他 TestFlight 组。

    ¥You can also specify additional TestFlight groups using the groups field in your eas.json submission profile.

  • 使用 TestFlight,你可以发布一个可供内部和外部测试的应用版本。TestFlight 允许最多 100 名内部测试人员共享,并提供一个公共链接,最多可与 10,000 名外部测试人员共享。

    ¥Using TestFlight, you can release a version of your app available for internal and external testing. TestFlight allows sharing with up to 100 testers internally and provides a public link to share with up to 10,000 external testers.

  • 发布到 Apple App Store 的审核是一个手动过程。提交到 TestFlight 后,你必须手动将版本推送到 App Store。

    ¥The release to Apple App Store review is a manual process. Once you have made a submission to TestFlight, you'll have to manually promote the build to the App Store.

此行为可确保所有 iOS 版本在使用 --auto-submit 时都经过 TestFlight 测试,从而允许你在决定向公众发布版本之前进行测试。

¥This behavior ensures that all iOS releases go through TestFlight when using --auto-submit, allowing you to test the release before deciding to make it available to the public.

修改 App Store 列表(仅限 iOS)

¥Modifying App Store listing (iOS only)

EAS Submit 本身不会更新商店元数据(应用描述、Apple 建议信息、语言等)。但是,一旦你使用 EAS Submit 将新版本号的构建版本上传到 Testflight,你就可以使用 EAS Metadata 更新此信息。

¥On its own, EAS Submit does not update store metadata (app description, Apple advisory information, languages, and so on). However, once you upload a build to Testflight with EAS Submit with a new version number, you can update this information with EAS Metadata.

EAS 元数据

了解如何自动更新 iOS 应用的元数据。