自动提交

了解如何使用 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 Submit,并使用相应的提交配置文件。有关如何设置和配置提交的更多信息,请参阅 EAS Submit 文档

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

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:

发布日期状态选项:

  • draft:创建需要在 Google Play 管理中心手动推广的草稿版本
  • completed:立即向指定轨道上的用户发布
  • inProgress:分阶段发布(与 rollout 百分比一起使用)
  • halted:暂停发布

当你在 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:

曲目选项:

  • internal:内部测试轨道(最多 100 名测试人员)(默认)
  • alpha:封闭测试轨道
  • beta:开放测试轨道
  • production:生产轨道(公开发布)

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 并可供内部测试。
  • 如果你在 App Store Connect 中开启了“启用自动分发”,TestFlight 将会自动创建一个测试组,并邀请所有内部 TestFlight 用户测试该版本。
  • 你还可以在 eas.json 提交配置文件中使用 groups 字段指定额外的 TestFlight 群组。
  • 使用 TestFlight,你可以发布一个可供内部和外部测试的应用版本。TestFlight 允许在内部与最多 100 名测试人员共享,并提供一个公共链接,供最多 10,000 名外部测试人员使用。
  • 发布到 Apple App Store 审核是一个手动过程。一旦你向 TestFlight 提交了应用,你需要手动将该版本提升到 App Store。

这种行为确保在使用 --auto-submit 时,所有 iOS 版本都会通过 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 应用元数据。