This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

开始使用 EAS 模拟器

检查 EAS 模拟器是否可用,启动远程设备会话,然后连接它。


先决条件

3 要求

1.

一个有 EAS 模拟器访问权限的 Expo 账户

EAS 模拟器的访问权限直接授予给特定合作伙伴。在开始会话前,检查当前项目的账户。

2.

一个关联的 Expo 项目

从项目目录运行这些命令。如果项目没有 EAS 项目 ID,请先运行 eas init。

3.

最近的 EAS CLI

simulator:* 命令是实验性的且隐藏的。安装或更新 EAS CLI 后再使用它们。由于预览版本变化快,请使用 eas simulator:start --help 检查你安装版本支持的标志。

AI代理的 Expo 技能

🌐 Expo Skills for AI agents

如果你使用 AI 代理,安装 Expo Skills 并让它使用 EAS 模拟器技能。这个技能可以执行下面的会话流程,操作应用,并为你收集证据。当你想要了解或手动运行命令时,可以使用此页面。

🌐 If you use an AI agent, install Expo Skills and ask it to use the EAS Simulator skill. The skill can perform the session workflow below, drive the app, and collect evidence for you. Use this page when you want to understand or run the commands manually.

eas-simulator

Run and control a user's app on a remote iOS/Android simulator hosted on EAS cloud.

手动开始会话

🌐 Start a session manually

下面的步骤使用 EAS CLI。要直接从你自己的 HTTP 客户端管理会话,请参阅 REST API 参考。要在有人打开已认证的 expo.dev URL 时启动仅浏览器预览会话,请参阅 创建会话链接。

🌐 The steps below use EAS CLI. To manage sessions directly from your own HTTP client, see the REST API reference. To start a browser-preview-only session when someone opens an authenticated expo.dev URL, see Create session links.

1

验证并确认项目

🌐 Authenticate and verify the project

在互动机器上,登录并确认当前用户:

🌐 On an interactive machine, log in and confirm the current user:

Terminal
- eas login
- eas whoami

在 CI 或无界面代理环境中,在 EXPO_TOKEN 中提供一个 Expo 访问令牌,而不是启动交互式登录。

🌐 In CI or a headless agent environment, provide an Expo access token in EXPO_TOKEN instead of starting an interactive login.

如果项目没有关联到 EAS,先初始化它:

🌐 If the project is not linked to EAS, initialize it:

Terminal
- eas init

2

查看账户可用性

🌐 Check account availability

可用性检查是只读的。它不会启动设备,也不会消耗模拟器使用。--json 标志是可选的,但它使结果更容易被代理或脚本检查:

🌐 The availability check is read-only. It does not start a device or consume simulator usage. The --json flag is optional, but it makes the result easy for an agent or script to inspect:

Terminal
- eas simulator:availability --json

启用的账户返回:

🌐 An enabled account returns:

{ "available": true, "accountName": "my-account" }

如果 available 是 false,不要调用 simulator:start。可以使用本地的模拟器或模拟器,或者加入候补名单获取访问权限。

🌐 If available is false, do not call simulator:start. Use a local simulator or emulator, or join the waitlist for access.

3

保护会话配置

🌐 Protect the session configuration

EAS CLI 会将当前会话 ID 和控制器凭据写入 .env.eas-simulator。在开始之前,把该文件添加到 .gitignore:

🌐 EAS CLI writes the current session ID and controller credentials to .env.eas-simulator. Add the file to .gitignore before starting:

.gitignore
.env.eas-simulator

不要提交或分享这个文件。它包含允许控制器访问远程设备的令牌。

🌐 Do not commit or share this file. It includes the token that lets a controller reach the remote device.

4

选择一个会话类型并启动远程设备

🌐 Choose a session type and start a remote device

选择你计划用于安装和设备操作的控制器。在 iOS 上,每个支持控制器的会话也包含一个网页预览。如果你只需要网页预览,可以在没有控制器的情况下使用 web-preview-only。启动会话时请明确传递会话类型。

🌐 Choose the controller you plan to use for installation and device actions. On iOS, each controller-backed session also includes a web preview. If you only need the web preview, use web-preview-only without a controller. Pass the session type explicitly when you start the session.

查看 agent-device 和 Expo 了解控制器的设置和命令。

🌐 See agent-device and Expo for controller setup and commands.

Terminal
- eas simulator:start --platform ios --type agent-device --name "Checkout flow screenshots" --non-interactive

给每个会议起一个简短的名字来描述它的目的。名字会出现在 simulator:list、simulator:get 和 expo.dev 上,这样更容易识别并行和历史会议。

🌐 Give each session a short name that describes its purpose. The name appears in simulator:list, simulator:get, and on expo.dev, which makes parallel and historical sessions easier to identify.

使用 --platform android 来运行 Android 模拟器。Android 会话目前不包括实时浏览器预览。使用 --device 来选择特定的 iOS 模拟器名称或唯一设备标识符(UDID),或者 Android 虚拟设备硬件配置。如果省略该选项,远程运行器会自动选择设备。

🌐 Use --platform android for an Android Emulator. Android sessions do not currently include a live browser preview. Use --device to select a specific iOS Simulator name or unique device identifier (UDID), or an Android virtual device hardware profile. If the flag is omitted, the remote runner chooses a device.

对于无人值守或可共享的会话,使用 --max-duration-minutes 设置自动停止时间。你也可以使用 --max-idle-time-minutes 在一段时间无会话活动后停止。付费计划还提供自定义最长时长。

🌐 For an unattended or shareable session, use --max-duration-minutes to set an automatic stop time. You can also use --max-idle-time-minutes to stop after a period without session activity. A custom maximum duration is available on paid plans.

当在交互式终端中省略 --platform 时,EAS CLI 会询问使用哪个平台。非交互式运行需要使用该标志。

🌐 When --platform is omitted in an interactive terminal, EAS CLI asks which platform to use. Non-interactive runs require the flag.

start 命令会等待会话准备就绪,然后写入 .env.eas-simulator。它还会打印:

🌐 The start command waits for the session to become ready, then writes .env.eas-simulator. It also prints:

  • expo.dev 上的直接模拟器会话页面
  • 用于支持的 iOS 会话的临时 webPreviewUrl
  • 控制设备的命令模式

在会话准备好之前安装并启动应用,请传递 --build-id、--application-archive-url 或 --expo-go 中的一个。你也可以传递启动参数以及 Expo 或开发客户端的 URL。完整示例请参见 运行和控制应用。

🌐 To install and launch an app before the session becomes ready, pass exactly one of --build-id, --application-archive-url, or --expo-go. You can also pass launch arguments and an Expo or development-client URL. See Run and control an app for complete examples.

5

确认会话是否活跃

🌐 Confirm that the session is active

使用 .env.eas-simulator 中的会话 ID:

🌐 Use the session ID from .env.eas-simulator:

Terminal
- eas simulator:get --json --non-interactive

当 status 是 IN_PROGRESS 并且 remoteConfig 存在时继续。已停止的会话仍然可能有旧的连接配置,所以仅凭 dotenv 文件不能证明设备是在线的。

🌐 Continue when status is IN_PROGRESS and remoteConfig is present. A stopped session can still have old connection configuration, so the dotenv file alone is not proof that the device is live.

6

打开网页界面

🌐 Open the web surfaces

开始命令会链接到一个这样的会话页面:

🌐 The start command links to a session page with this shape:

https://expo.dev/accounts/<account>/projects/<project>/simulator-sessions/<session-id>

项目级别的会议列表是:

🌐 The project-level session list is:

https://expo.dev/accounts/<account>/projects/<project>/simulator-sessions

对于支持的 iOS 会话,在桌面浏览器中打开 webPreviewUrl 以查看和互动实时模拟器。预览 URL 不是应用的深度链接。不要将其传递给打开应用或 URL 的控制器命令。

🌐 For supported iOS sessions, open webPreviewUrl in a desktop browser to view and interact with the live simulator. The preview URL is not an application deep link. Do not pass it to a controller command that opens apps or URLs.

7

停止会话

🌐 Stop the session

当你完成时,停止当前会话:

🌐 When you finish, stop the current session:

Terminal
- eas simulator:stop

如果你在没有 --non-interactive 的情况下启动了 EAS CLI,它会继续保持连接。按一次 Ctrl+C 停止会话,让 EAS CLI 重置 .env.eas-simulator。

🌐 If you started EAS CLI without --non-interactive, it remains attached. Press Ctrl+C once to stop the session and let EAS CLI reset .env.eas-simulator.