使用自动管理的凭据

了解如何使用 EAS 自动管理你的应用凭据。


要在应用商店中发布你的应用,必须使用诸如密钥库或分发证书等凭证进行数字签名。这可以证明应用的来源,并确保其不被篡改。其他凭证,例如你的 FCM API 密钥和 Apple 推送密钥,是发送推送通知所必需的,但它们不涉及应用签名。

🌐 For your app to be distributed in an app store, it needs to be digitally signed with credentials such as a keystore or a distribution certificate. This certifies the source of the app and ensures that it can't be tampered with. Other credentials, such as your FCM API Key and Apple Push Key are needed to send push notifications, but they are not involved in app signing.

关于使用 EAS Build 构建应用,你只需要知道这些内容即可,但如果你想了解更多,可以参考 应用签名 指南。

🌐 That's all that you need to know about any of this to build an app with EAS Build, but if you would like to learn more you can refer to the App Signing guide.

请继续阅读,了解 EAS 如何自动为你和你的团队管理凭证。

🌐 Read on to learn how EAS can automatically manage credentials for you and your team.

生成应用签名凭据

🌐 Generating app signing credentials

当你运行 eas build 时,如果你还没有生成凭证,将会提示你生成凭证。按照简单的说明生成你的凭证。如有需要,它们将被存储在 EAS 服务器上。在你应用的后续构建中,这些凭证将会被重复使用,除非你另有指定。

🌐 When you run eas build, you will be prompted to generate credentials if you have not done so already. Follow the simple instructions to generate your credentials. Where needed, they will be stored on EAS servers. On subsequent builds of your app, these credentials will be re-used unless you specify otherwise.

生成你的 iOS 凭证(分发证书、配置描述文件和推送密钥)需要你使用 Apple 开发者计划 会员身份登录。

🌐 Generating your iOS credentials (distribution certificate, provisioning profile, and push key) requires you to sign in with an Apple Developer Program membership.

如果你对 EAS 管理你的凭据或通过 EAS CLI 登录你的 Apple 开发者账户有任何安全疑虑,请参阅 安全 指南。如果这仍无法消除你的顾虑,你可以联系 secure@expo.dev 获取更多信息,或者改为使用 本地凭据

推送通知凭证

🌐 Push notification credentials

安卓

🌐 Android

EAS Build 的 Android 推送通知凭证设置需要使用 FCM 配置你的应用。运行 eas credentials,选择 Android,然后选择 Push Notifications: Manage your FCM Api Key,接着选择合适的选项来设置密钥。

🌐 The Android push notification credentials setup for EAS Build requires configuring your app with FCM. Run eas credentials, select Android, then Push Notifications: Manage your FCM Api Key, and then choose the appropriate option to set up the key.

iOS

如果你还没有设置推送通知密钥,EAS CLI 会在下一次运行 eas build 时提示你进行设置。

🌐 If you haven't set up your Push Notifications key yet, EAS CLI will ask you to set it up during the next eas build run.

你也可以使用 eas credentials 命令设置推送通知密钥。运行该命令,选择 iOS,然后选择 Push Notifications: Manage your Apple Push Notifications Key,然后选择适当的选项来设置密钥。

🌐 You can also set up the Push Notifications key with the eas credentials command. Run it, select iOS, then Push Notifications: Manage your Apple Push Notifications Key, and then choose the appropriate option to set up the key.

与你的团队共享凭据

🌐 Sharing credentials with your team

如果你与其他开发者合作进行项目,通常允许他们自行执行构建是非常有用的。确保你的项目已配置为支持协作,并且通过你的EAS仪表板添加的任何团队成员,只要拥有足够的权限,就能够无缝运行 eas build

🌐 If you collaborate on your project with other developers, it is often useful to give them access to perform builds on their own. Ensure that your project is configured for collaboration and any teammates that you have added through your EAS dashboard will be able to run eas build seamlessly, provided that they have sufficient permissions.

在生成 iOS 凭证后,就不再需要访问 Apple 开发者团队即可开始构建。这意味着你的协作者只需使用他们的 Expo 账户即可启动新的 iOS 构建。

🌐 After you have generated your iOS credentials, it's no longer necessary to have access to the Apple Developer team to start a build. This means that your collaborators can start new iOS builds with only their Expo accounts.

检查凭证配置

🌐 Inspecting credentials configuration

你可以通过运行 eas credentials 来查看当前配置的应用签名凭据。此命令还允许你在需要时删除和修改凭据。通常情况下,这不是必需的,但如果你想[将凭据同步到本地机器以本地运行构建](/app-signing/syncing-credentials/) 或[将现有凭据迁移为自动管理](/app-signing/existing-credentials/),你可能会想使用它。

🌐 You can view your currently configured app signing credentials by running eas credentials. This command also lets you remove and modify credentials, should you need to make any changes. Typically this is not necessary, but you may want to use it if you want to sync your credentials to your local machine to run a build locally or migrate existing credentials to be automatically managed.