了解如何使用 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 构建应用所需了解的全部内容,但如果你想了解更多信息,可以参考 应用签名 指南。
¥Thankfully, 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 凭据(分发证书、配置文件和推送密钥)需要你使用 苹果开发者计划 成员身份登录。
¥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 了解更多信息,或使用 本地凭证。
¥If you have any security concerns about EAS managing your credentials or about logging in to your Apple Developer account through EAS CLI, please refer to the "Security" guide. If that does not satisfy your concerns, you can reach out to secure@expo.dev for more information, or use local credentials instead.
¥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
如果你与其他开发者合作开发你的项目,那么授予他们自行执行构建的权限通常很有用。确保你的项目配置为协作 和你通过 Expo 仪表板 添加的任何队友将能够无缝运行 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 Expo 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
查看当前配置的应用签名凭据。如果你需要进行任何更改,此命令还允许你删除和修改凭据。通常这不是必需的,但如果你想要 将你的凭据同步到本地计算机以在本地运行构建 或 迁移现有凭证以进行自动管理,你可能需要使用它。
¥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.