了解如何在远程和本地源之间同步凭据。
如果你使用自动管理的凭据,你的凭据将远程托管在 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 并导航到 "签名和能力" 部分,然后导入你的配置文件并选择它。
¥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
要从 credential.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.