了解如何从计算机和 CI 向 Apple App Store 提交应用。
本指南概述了如何从你自己的计算机和 CI 向 Apple App Store 提交应用。
¥This guide outlines how to submit your app to the Apple App Store from your own computer and from CI.
¥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 CLI 并使用你的 Expo 账户进行身份验证:
¥You will also need to have EAS CLI installed and authenticated with your Expo account:
-
npm install -g eas-cli && eas login
1
2
¥Start the submission
要将二进制文件提交到 App Store,请从项目目录中运行 eas submit -p ios
。该命令将引导你逐步完成提交应用的过程。请参阅 使用 eas.json 进行配置 页面以了解如何预先配置你的提交。
¥To submit the binary to the App Store, run eas submit -p ios
from inside your project directory. The command will lead you step by step through the process of submitting the app. See the Configuration with eas.json page to learn how to pre-configure your submission.
尽管可以将任何二进制文件上传到商店,但每次提交都与一个 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.
如果你尚未生成 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.
要将你的 iOS 应用上传到 Apple App Store,请运行 eas submit --platform ios
并按照屏幕上的说明进行操作。
¥To upload your iOS app to the Apple App Store, run eas submit --platform ios
and follow the instructions on the screen.
该命令将执行以下步骤:
¥The command 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.
¥Submitting your app using CI
eas submit
命令能够从 CI 环境执行提交。你所要做的就是确保通过 eas.json 和环境变量提供了所有必需的信息。
¥The eas submit
command is able to perform submissions from a CI environment. All you have to do is ensure that all required information is provided with eas.json and environment variables.
你必须执行以下操作:
¥You must do the following:
提供存档源(--latest
、--id
、--path
或 --url
)。
¥Provide the archive source (--latest
, --id
, --path
, or --url
).
确保你的 应用配置文件 中存在 iOS 打包包标识符。
¥Make sure that the iOS Bundle Identifier is present in your app config file.
设置 ASC 应用 ID(eas.json 中的 ascAppId
)。需要 ASC 应用 ID 才能跳过 Apple 开发者登录过程,由于 2FA 提示,这在 CI 上可能无法实现。
¥Set the ASC App ID (ascAppId
in eas.json). The ASC App ID is required to skip the Apple Developer log-in process, which will likely not be possible on CI due to the 2FA prompt.
使用 EAS 服务器设置你的 App Store Connect API 密钥。你可以通过运行 eas credentials
或交互运行 eas submit -p ios
来检查凭据的状态。
¥Set up your App Store Connect API Key with EAS Servers. You can check the state of your credentials by running eas credentials
or by running eas submit -p ios
interactively.
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.
用法示例:
¥Example usage:
-
eas submit -p ios --latest --profile foobar
¥Manual submissions
如果你需要在不通过 EAS Submit 的情况下提交构建,例如,如果服务暂时无法维护,你可以从 macOS 设备手动上传到 Apple App Store。
¥If you ever need to submit your build without going through EAS Submit, for example, if the service is temporarily unavailable for maintenance, you can upload to the Apple App Store manually from a macOS device.
¥Creating an entry on App Store Connect
首先在 App Store Connect 中创建应用配置文件(如果你尚未创建):
¥Start by creating an app profile in App Store Connect, if you haven't already:
前往 应用商店连接 并登录。确保你已接受页面顶部的所有法律声明或条款。
¥Go to App Store Connect and sign in. Make sure you have accepted any legal notices or terms at the top of the page.
单击“应用”标题旁边的蓝色加号按钮,然后单击“新建应用”。
¥Click the blue plus button by the Apps header, then click New App.
添加应用的名称、语言、打包包标识符和 SKU(终端用户看不到它,它可以是任何唯一字符串。常见的选择是应用的打包包标识符,例如 "com.company.my-app")。
¥Add your app's name, language, bundle identifier, and SKU (this isn't seen by end users, it can be any unique string. A common choice is your app's bundle identifier, for example, "com.company.my-app").
单击“创建”。如果成功,则你已创建应用记录。
¥Click Create. If this succeeds, then you have created your application record.
¥Uploading with Transporter
最后,你需要将 IPA 上传到 Apple App Store。
¥Finally, you need to upload the IPA to the Apple App Store.
下载 App Store 中的运输车。
¥Download Transporter from the App Store.
使用你的 Apple ID 登录。
¥Sign in with your Apple ID.
通过将 IPA 文件直接拖到 Transporter 窗口中或从使用 + 或添加应用按钮打开的文件对话框中选择它来添加构建。
¥Add the build either by dragging the IPA file directly into the Transporter window or by selecting it from the file dialog opened with + or Add App button.
单击“交付”按钮提交。
¥Submit it by clicking the Deliver button.
此过程可能需要几分钟,然后在 Apple 服务器上再处理 10-15 分钟。之后,你可以在 应用商店连接 中检查二进制文件的状态:
¥This process can take a few minutes, then another 10-15 minutes of processing on Apple's servers. Afterward, you can check the status of your binary in App Store Connect:
访问 应用商店连接,选择我的应用,然后单击你之前创建的应用条目。
¥Visit App Store Connect, select My Apps, and click on the app entry you created earlier.
向下滚动到“构建”部分并选择新上传的二进制文件。
¥Scroll down to the Build section and select your newly uploaded binary.
¥Automating submissions
要了解如何在成功构建后自动提交应用,请参阅 自动提交。
¥To learn how to automatically submit your app after a successful build, refer to the Automating submissions.