在远程和本地源之间同步凭据

了解如何在远程和本地源之间同步凭据。


如果你使用自动管理的凭据,你的凭据将托管在 EAS 服务器上,但你可能会遇到希望将凭据拉下到本地以运行构建的情况。如果你使用本地凭据,你可能会希望将 credentials.json 中指定的凭据上传到 EAS 以由其帮你管理。这两种情况都可以使用 eas credentials 命令实现。

🌐 If you use automatically managed credentials, your credentials will be hosted remotely on EAS servers, but you may encounter a situation where you want to pull your credentials down to run a build locally. And if you use local credentials, you may find yourself in a position where you want to upload credentials specified in credentials.json up to EAS to be managed for you. Both of these are possible using the eas credentials command.

下载凭证

🌐 Downloading credentials

要下载自动管理的凭证,请在项目根目录运行 eas credentials,选择一个平台,选择 "Credentials.json: Upload/Download credentials between EAS servers and your local json",然后选择 "Download credentials from EAS to credentials.json"。如有需要,可再次运行该命令以下载另一个平台的凭证。

🌐 To download your automatically managed credentials, run eas credentials in the root of your project, pick a platform, choose "Credentials.json: Upload/Download credentials between EAS servers and your local json", and then "Download credentials from EAS to credentials.json". Run the command again to download the credentials for another platform, if needed.

Android 凭证将可以立即使用,因为你的项目将从 credentials.json 中读取凭证。

🌐 Android credentials will be ready to use immediately because your project will read the credentials from credentials.json.

iOS 凭证需要两步才能在本地设置。你首先需要将分发证书安装到你的密钥串中。接下来,打开你的 Xcode 项目并导航到“Signing & Capabilities”部分,然后导入你的配置文件并选择它。

🌐 iOS credentials require two steps to set up locally. You will first need to install the distribution certificate into your keychain. Next, open your project Xcode and navigate to the "Signing & Capabilities" section, then import your provisioning profile and select it.

上传凭证

🌐 Uploading credentials

要将你的凭证从 credentials.json 上传以由 EAS 管理,请在项目根目录运行 eas credentials,选择一个平台,选择 "Credentials.json: Upload/Download credentials between EAS servers and your local json",然后 "Upload credentials from credentials.json to EAS"。如有需要,再次运行该命令以上传其他平台的凭证。

🌐 To upload your credentials from credentials.json to be managed by EAS, run eas credentials in the root of your project, pick a platform, choose "Credentials.json: Upload/Download credentials between EAS servers and your local json", and then "Upload credentials from credentials.json to EAS". Run the command again to upload the credentials for another platform, if needed.