首页指南参考教程

开始使用 EAS 元数据

了解如何使用 EAS 元数据从命令行自动化和维护应用商店的存在。


EAS 元数据处于测试阶段,可能会发生重大变化。

EAS 元数据使你能够从命令行自动化并维护应用商店的状态。它使用包含所有必需的应用信息的 store.config.json 文件,而不是通过多种不同的形式。它还尝试通过内置验证来查找可能导致应用拒绝的常见陷阱。

¥EAS Metadata enables you to automate and maintain your app store presence from the command line. It uses a store.config.json file containing all required app information instead of going through multiple different forms. It also tries to find common pitfalls that could cause app rejections with built-in validation.

先决条件

¥Prerequisites

EAS 元数据目前仅支持 Apple App Store。

¥EAS Metadata currently only supports the Apple App Store.

使用 VS Code?在 store.config.json 文件中安装 Expo 工具扩展 以实现自动补齐、建议和警告。

¥Using VS Code? Install the Expo Tools extension for auto-complete, suggestions, and warnings in your store.config.json files.

创建存储配置

¥Create the store config

让我们首先在项目的根目录中创建 store.config.json 文件。该文件包含你要上传到应用商店的所有信息。

¥Let's start by creating our store.config.json file in the root directory of your project. This file holds all the information you want to upload to the app stores.

如果你在商店中已有应用,则可以通过运行以下命令将信息提取到存储配置中:

¥If you already have an app in the stores, you can pull the information into a store config by running:

Terminal
eas metadata:pull

如果你的商店中还没有应用,EAS 元数据无法为你生成存储配置。相反,创建一个新的存储配置文件。

¥If you don't have an app in the stores yet, EAS Metadata can't generate the store config for you. Instead, create a new store config file.

store.config.json
{
  "configVersion": 0,
  "apple": {
    "info": {
      "en-US": {
        "title": "Awesome App",
        "subtitle": "Your self-made awesome app",
        "description": "The most awesome app you have ever seen",
        "keywords": ["awesome", "app"],
        "marketingUrl": "https://example.com/en/promo",
        "supportUrl": "https://example.com/en/support",
        "privacyPolicyUrl": "https://example.com/en/privacy"
      }
    }
  }
}

默认情况下,EAS 元数据使用项目根目录下的 store.config.json 文件。你可以通过设置 eas.json metadataPath 属性来更改此文件的名称和位置。

¥By default, EAS Metadata uses the store.config.json file at the root of your project. You can change the name and location of this file by setting the eas.json metadataPath property.

更新存储配置

¥Update the store config

现在是时候编辑 store.config.json 文件并根据你的应用需求进行自定义了。你可以在 存储配置架构 中找到所有可用选项。

¥Now it's time to edit the store.config.json file and customize it to your app needs. You can find all available options in the store config schema.

上传新的应用版本

¥Upload a new app version

在将 store.config.json 推送到应用商店之前,你必须上传应用的新二进制文件。欲了解更多信息,请参阅 将新的二进制文件上传到商店

¥Before pushing the store.config.json to the app stores, you must upload a new binary of your app. For more information, see uploading new binaries to stores.

提交并处理二进制文件后,我们可以将存储配置推送到应用商店。

¥After the binary is submitted and processed, we can push the store config to the app stores.

上传存储配置

¥Upload the store config

当你对 store.config.json 设置感到满意时,我们可以将其发送到应用商店。你可以通过运行以下命令将存储配置推送到应用商店:

¥When you are happy with the store.config.json settings, we can send it to the app stores. You can push the store config to the app stores by running:

Terminal
eas metadata:push

如果 EAS 元数据在你的存储配置中遇到任何问题,它会在运行此命令时向你发出警告。当没有错误,或者你确认推送但可能存在问题时,它会尝试上传尽可能多的内容。

¥If EAS Metadata runs into any issues with your store config, it will warn you when running this command. When there are no errors, or you confirm to push it with possible issues, it will try to upload as much as possible.

当存储配置部分失败时,你可以更改存储配置并重试。eas metadata:push 可用于重试推送丢失的项目。

¥When the store config partially fails, you can change the store config and retry. eas metadata:push can be used to retry pushing the missing items.

下一步

¥Next steps

自定义存储配置

自定义存储配置以使 EAS 元数据适应你的首选工作流程。

存储配置架构

探索 EAS 元数据提供的所有可配置选项。

Expo 中文网 - 粤ICP备13048890号