首页指南参考教程

自动提交

了解如何使用 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 变量,因此名称将为 '我的应用',包标识符将为 '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'.

Expo 中文网 - 粤ICP备13048890号