了解如何使用 EAS Submit 从命令行将应用提交到 Google Play 商店和 Apple App Store。
EAS Submit 是一项托管服务,允许使用 EAS CLI 上传应用二进制文件并将其提交到应用商店。本指南介绍如何使用 EAS Submit 将你的应用提交到 Google Play Store 和 Apple App Store。
¥EAS Submit is a hosted service that allows uploading and submitting app binaries to the app stores using EAS CLI. This guide describes how to submit your app to the Google Play Store and Apple App Store using EAS Submit.
¥Google Play Store
¥Prerequisites
需要付费开发者账户 — 你可以在 Google Play 管理中心注册页面 上创建 Google Play 开发者账户。
¥A paid developer account is required — You can create a Google Play Developer account on the Google Play Console sign-up page.
创建 谷歌服务账户 并下载其 JSON 私钥。
¥Create a Google Service Account and download its JSON private key.
在 谷歌游戏控制台 上创建一个应用并至少手动上传一次应用。
¥Create an app on Google Play Console and upload your app manually at least once.
使用 EAS Build 为 Google Play 商店提交签名的原生应用二进制文件。如果你没有遵循之前的指南,请参阅 为应用商店构建你的项目 了解更多信息。
¥Native app binary signed for Google Play Store submission using EAS Build. If you haven't followed the previous guide, see Build your project for app stores for more information.
尽管可以将任何二进制文件上传到商店,但每次提交都与一个 Expo 项目相关联。这就是为什么从项目目录内部开始提交很重要,因为 应用配置 是在该目录内定义的。
¥Although it's possible to upload any binary to the store, each submission is associated with an Expo project. That's why it's important to start a submission from inside your project's directory because app config is defined inside that directory.
¥Submit binary to Google Play Store
要将应用二进制文件提交到 Google Play 商店,请从项目目录中运行以下命令:
¥To submit the app binary to Google Play Store, run the following command from inside your project's directory:
-
eas submit -p android
该命令将引导你完成提交应用的过程。它将执行以下步骤:
¥The command will lead you through the process of submitting the app. It will perform the following steps:
登录你的 Expo 账户并确保你的应用项目存在于 EAS 服务器上。
¥Log in to your Expo account and ensure that your app project exists on EAS servers.
提示输入 Android 包名称,除非在应用配置中设置了 android.package
。
¥Prompt for the Android package name unless android.package
is set in the app config.
询问要提交哪个二进制文件。你可以选择以下选项之一:
¥Ask for which binary to submit. You can select one of the following:
EAS 服务器上项目的最新 Android 版本已完成。
¥The latest finished Android build for the project on EAS servers.
特定的构建 ID。它可以在 构建仪表板 上找到。
¥Specific build ID. It can be found on the builds dashboard.
本地文件系统上 .apk 或 .aab 存档的路径。
¥Path to an .apk or .aab archive on your local filesystem.
应用存档的 URL。
¥URL to the app archive.
如果提供以下 CLI 参数之一,则可以跳过此步骤:
--latest
、--id
、--path
或--url
。¥This step can be skipped if one of the following CLI parameters is provided:
--latest
,--id
,--path
, or--url
.
除非 eas.json 中提供了 serviceAccountKeyPath
,否则系统将提示你输入 Google 服务 JSON 密钥的路径。
¥Unless serviceAccountKeyPath
is provided in eas.json, you will be prompted for the path to your Google Services JSON key.
将显示所提供配置的摘要,并开始提交过程。屏幕上会显示提交进度。
¥The summary of provided configuration is displayed and the submission process begins. The submission progress is displayed on the screen.
你的构建现在应该可以在 Google Play Console 上看到。如果出现问题,屏幕上会显示相应的消息。
¥Your build should now be visible on Google Play Console. If something goes wrong, an appropriate message is displayed on the screen.
¥Apple App Store
¥Prerequisites
提交应用需要付费开发者账户 - 你可以在 苹果开发者门户 上创建 Apple 开发者账户。
¥A paid developer account is required to submit an app — you can create an Apple Developer account on the Apple Developer Portal.
使用 EAS Build 为 Apple App Store 提交签名的原生应用二进制文件。如果你没有遵循之前的指南,请参阅 为应用商店构建你的项目 了解更多信息。
¥Native app binary signed for Apple App Store submission using EAS Build. If you haven't followed the previous guide, see Build your project for app stores for more information.
¥Submit binary to Apple App Store
如果你尚未生成 App Store Connect API 密钥,你可以登录你的 Apple 开发者计划账户并按照提示操作,让 EAS CLI 为你处理此事宜。你还可以上传自己的 API 密钥 或传入 Apple 应用专用密码。
¥If you have not generated an App Store Connect API Key yet, you can let EAS CLI take care of that for you by signing into your Apple Developer Program account and following the prompts. You can also upload your own API Key or pass in an Apple app-specific password.
要将二进制文件提交到 App Store,请从项目目录中运行以下命令:
¥To submit the binary to the App Store, run the following command from inside your project's directory:
-
eas submit -p ios
该命令将引导你完成提交应用的过程。它将执行以下步骤:
¥The command will lead you through the process of submitting the app. It will perform the following steps:
登录你的 Expo 账户并确保你的应用项目存在于 EAS 服务器上。
¥Log in to your Expo account and ensure that your app project exists on EAS servers.
确保你的应用存在于 App Store Connect 上,并且其 打包包标识符 已在 Apple Developer Portal 上注册:
¥Ensure that your app exists on App Store Connect and its Bundle Identifier is registered on Apple Developer Portal:
系统会要求你登录你的 Apple 开发者账户并选择你的团队。你还可以通过在提交配置文件中设置 appleId
和 appleTeamId
在 eas.json 中提供此信息。Apple ID 密码必须使用 EXPO_APPLE_PASSWORD
环境变量进行设置。
¥You will be asked to log in to your Apple Developer account and select your team. You can also provide this information in eas.json by setting appleId
and appleTeamId
in the submit profile. The Apple ID password has to be set with the EXPO_APPLE_PASSWORD
environment variable.
该命令将在应用配置中查找 ios.bundleIdentifier
。
¥The command will look for ios.bundleIdentifier
in the app config.
如果你是第一次提交应用,它将自动创建。除非在你的应用配置中找到 expo.name
或在 eas.json 中提供了 appName
,否则系统将提示你输入应用名称。你还可以使用 eas.json 中的 language
和 sku
键指定应用的语言和 SKU。如果你以前从未提交过任何应用,你可能还需要使用 companyName
指定你的公司名称。
¥If you are submitting your app for the first time, it will be automatically created.
Unless expo.name
in your app configuration is found or appName
is provided in eas.json, you will be prompted for the app name.
You can also specify your app's language and SKU using language
and sku
keys in eas.json. If you have never submitted any app before, you may also have to specify your company name with companyName
.
如果你已经有 App Store Connect 应用,则可以通过在提交配置文件中提供
ascAppId
来跳过此步骤。ASC 应用 ID 可以在 App Store Connect 上找到,或者稍后在提交摘要表中执行此命令时找到。¥If you already have an App Store Connect app, this step can be skipped by providing the
ascAppId
in the submit profile. The ASC App ID can be found either on App Store Connect, or later during this command in the Submission Summary table.
确保你设置了正确的凭据。如果找不到,你可以让 EAS CLI 为你设置一些。
¥Ensure you have the proper credentials set up. If none can be found, you can let EAS CLI set some up for you.
App Store 连接 API 密钥:创建你自己的 API 密钥,然后使用 eas.json 中的 ascApiKeyPath
、ascApiKeyIssuerId
和 ascApiKeyId
字段进行设置。
¥App Store Connect API Key: Create your own API Key then set it with the ascApiKeyPath
, ascApiKeyIssuerId
, and ascApiKeyId
fields in eas.json.
应用专用密码:通过分别将 password 和 Apple ID 用户名与 eas.json 中的 EXPO_APPLE_APP_SPECIFIC_PASSWORD
环境变量和 appleId
字段一起传递来提供你的 password 和 Apple ID 用户名。
¥App Specific Password: Provide your password and Apple ID Username by passing them in with the EXPO_APPLE_APP_SPECIFIC_PASSWORD
environment variable and appleId
field in eas.json, respectively.
询问要提交哪个二进制文件。你可以选择以下选项之一:
¥Ask for which binary to submit. You can select one of the following:
EAS 服务器上该项目的最新成功 iOS 版本。
¥The latest successful iOS build for the project on EAS servers.
特定的构建 ID。它可以在 构建仪表板 上找到。
¥Specific build ID. It can be found on the builds dashboard.
本地文件系统上 .ipa 存档的路径。
¥Path to an .ipa archive on your local filesystem.
应用存档的 URL。
¥URL to the app archive.
如果提供以下 CLI 参数之一,则可以跳过此步骤:
--latest
、--id
、--path
或--url
。¥This step can be skipped if one of the following CLI parameters is provided:
--latest
,--id
,--path
, or--url
.
将显示所提供配置的摘要,并开始提交过程。屏幕上会显示提交进度。
¥A summary of the provided configuration is displayed and the submission process begins. The submission progress is displayed on the screen.
你的构建现在应该在 应用商店连接 上可见。如果出现问题,屏幕上会显示相应的消息。
¥Your build should now be visible on App Store Connect. If something goes wrong, an appropriate message is displayed on the screen.
¥Next step
了解如何使用 eas.json 文件和 EAS Submit 来预配置你的项目,以及有关 Android 或 iOS 特定选项的更多信息。