This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
使用 EAS CLI 查询
使用 eas observe 命令从终端查询 EAS 的指标、事件和会话。
所有 EAS Observe 仪表板 显示的内容,也可以在终端中查看。使用 eas observe 命令来比较版本,调查慢速会话,并将结果传输到脚本中。
🌐 Everything the EAS Observe dashboard shows is also available from the terminal. Use the eas observe commands to compare releases, investigate slow sessions, and pipe results into scripts.
先决条件
🌐 Prerequisites
3 要求
3 要求
1.
请按照安装 CLI 的说明操作。
2.
按照入门指南安装expo-observe并创建你的第一个构建。
3.
使用eas login登录。默认情况下,每个命令都会从当前目录的应用配置中读取项目 ID。使用--project-id可以从任何地方查询项目,前提是使用的账户有访问权限:
EAS CLI 帮助
🌐 EAS CLI help
使用 --help 运行任何命令以查看你安装的 EAS CLI 版本支持的所有标志。
🌐 Run any command with --help to see the flags supported by your installed EAS CLI version.
有些数据仅在特定套餐中可用。当你的账户套餐不包含某条命令所需的内容时,命令会失败,并显示带有升级链接的提示,链接会跳转到你的账单页面。会话时间线会在交互选取器运行前进行检查,所以被限制的套餐会立即被报告。查看Pricing了解每个套餐包含的内容。
🌐 Some data is available only on certain plans. When your account's plan does not include what a command asks for, the command fails with an upgrade message that links to your billing page. Session timelines are checked before the interactive picker runs, so a blocked plan is reported immediately. See Pricing for what each plan includes.
命令
🌐 Commands
每个命令都接受这些标志:
🌐 Every command accepts these flags:
--platform android或--platform ios:按平台筛选。默认都会包含。observe:session不可用,它已经只针对一个会话。--days <number>:显示过去 N 天的数据。--start <ISO date>和--end <ISO date>:设置一个明确的时间范围。与--days互斥。--project-id <id>:在不进入项目目录的情况下查询项目。--json:机器可读的输出。意味着--non-interactive。--non-interactive:失败而不是提示。
如果没有给出时间范围,命令会返回最近 60 天的数据。
🌐 When no time range is given, commands return the last 60 days.
指标名称
🌐 Metric names
一旦应用安装了监测工具,启动指标就会自动收集。查看指标参考了解每个指标的具体含义。
🌐 Startup metrics are collected automatically once the app is instrumented. See the Metrics reference for what each one measures.
导航指标是按路由计算的。它们需要 SDK 56 或更高版本,以及其中一种导航集成:要么是 Expo Router,要么是 React Navigation。
🌐 Navigation metrics are per route. They require SDK 56 or later and one of the navigation integrations, either Expo Router or React Navigation.
observe:metrics 和 observe:metrics-summary 接受所有九个名字。observe:routes 接受三个导航名字。
eas observe:metrics-summary
显示按应用版本汇总的统计数据,每个平台有单独的表格。用它来比较各版本的启动性能。
🌐 Shows aggregated statistics grouped by app version, with a separate table per platform. Use it to compare startup performance across releases.
命令标志:
🌐 Command flags:
--metric <name>:要显示的指标。对多个指标重复使用该标志。--stat <name>:每个指标要显示的统计数据。可以是min、median、max、average、p80、p90、p99或eventCount中的一个。
表格默认显示 median 和 eventCount,并将它们合并为一个单元格,例如 0.45s (150)。应用版本列会在括号里显示构建号。为了保持表格的可读性,更新 ID 被省略了,但 --json 会按版本返回它们的数组。
🌐 The table shows median and eventCount by default, and merges them into one cell, such as 0.45s (150). The App version column includes the build number in parentheses. Update IDs are omitted from the table to keep it readable, but --json returns them as an array per version.
eas observe:metrics
显示单个样本,而不是汇总数据。用它来调查异常值,并找出造成启动慢的那个会话。
🌐 Shows individual samples rather than aggregates. Use it to investigate outliers and to find the session behind a slow launch.
这个指标是一个位置参数。省略它会提示选择,在非交互模式下会失败。
🌐 The metric is a positional argument. Omitting it prompts for a choice, and fails in non-interactive mode.
命令标志:
🌐 Command flags:
--sort <order>:oldest(默认)、newest、slowest或fastest之一。--limit <number>:每页样本数。默认是10,最多100。--after <cursor>:来自上一次运行的endCursor。--app-version <version>:按应用版本过滤。--update-id <id>:按 EAS 更新 ID 筛选。
当有更多结果可用时,该命令会打印获取下一页所需的标志。JSON 输出会添加 sessionId、easClientId,以及附加到样本的任何自定义参数。
🌐 When more results are available, the command prints the flag needed to fetch the next page. JSON output adds sessionId, easClientId, and any custom params attached to the sample.
eas observe:routes
显示按路由名称分组的导航指标,每个平台都有单独的部分。用它来找出到达最慢的屏幕。
🌐 Shows navigation metrics grouped by route name, with a separate section per platform. Use it to find the screens that are slowest to reach.
命令标志:
🌐 Command flags:
--metric <name>:nav_cold_ttr、nav_warm_ttr或nav_tti中的一个。对多个指标重复使用该标志。默认使用全部三个。--stat <name>:median、p90或count中的一个。--route-name <name>:按路由名称筛选。对多个路由重复使用该标志。--app-version <version>和--build-number <number>:筛选到一个版本。--update-id <id>:按 EAS 更新 ID 筛选。--limit <number>:每页路由数。默认是50,最多200。--after <cursor>:来自上一次运行的endCursor。
路由名称是模式,例如 /(tabs)/sessions/[sessionId],所以不同的参数值会分组在一起。每个平台分别分页,因此下一页提示会标明它适用的平台。
🌐 Route names are patterns, such as /(tabs)/sessions/[sessionId], so distinct parameter values group together. Each platform paginates separately, so the next-page hint names the platform it applies to.
eas observe:session
显示一个会话中记录的所有指标和日志事件,按顺序排列。在 observe:metrics 显示慢速样本后使用它,以查看该次启动期间还发生了什么。
🌐 Shows every metric and log event recorded during one session, in order. Use it after observe:metrics surfaces a slow sample, to see what else happened during that launch.
会话 ID 是一个位置参数。在交互模式下省略它会提示你从候选会话列表中选择。在非交互模式下,包括在 --json 下,则必须提供会话 ID。会话 ID 也会包含在 observe:metrics 和 observe:events 的 --json 输出中。
🌐 The session ID is a positional argument. Omitting it in interactive mode prompts you to pick from a list of candidate sessions. In non-interactive mode, including under --json, the session ID is required. Session IDs are also included in the --json output of observe:metrics and observe:events.
命令标志:
🌐 Command flags:
--event-name <name>:用于构建候选列表的指标或用户自定义事件,例如tti或onboarding.completed。--sort <order>:对候选事件进行排序。可以是slowest、fastest、newest或oldest中的一个。
信息 用于构建候选列表的标志 —
--event-name、--sort、--days、--start和--end— 描述了如何去 查找 会话,所以它们不能和会话 ID 一起使用。要检查已有的会话,请单独传入该 ID。
eas observe:events
显示使用 Observe.logEvent 记录的 用户定义事件,以及 SDK 及其集成发出的 事件,比如 expo.memory.warning 和 expo-image.oversized。如果没有参数,它会列出事件名称及其数量。
🌐 Shows user-defined events logged with Observe.logEvent, as well as events emitted by the SDK and its integrations, such as expo.memory.warning and expo-image.oversized. With no arguments, it lists event names and their counts.
命令标志:
🌐 Command flags:
--all-events:列出每个事件,而不是名称摘要。不能和事件名称合并。--session-id <id>:筛选到一个会话。要查看完整时间线,包括指标,请使用observe:session。--app-version <version>:按应用版本过滤。--update-id <id>:按 EAS 更新 ID 筛选。--limit <number>和--after <cursor>:对结果进行分页。
查询一个没有事件的名称时,会打印同一时间范围内可用的名称,这使得很容易发现拼写错误。
🌐 Querying a name that has no events prints the available names for the same time range, which makes typos easy to spot.
eas observe:versions
列出该字段中的应用版本及其构建号、更新 ID 和事件数量。用它来查找其他命令用来过滤的标识符。
🌐 Lists the app versions in the field with their build numbers, update IDs, and event counts. Use it to find the identifiers that the other commands filter by.
这张表显示了应用版本、首次出现时间、事件、用户、构建以及更新情况。JSON 输出返回完整层级结构,每个版本下都嵌套了 EAS 构建和更新详情。
🌐 The table shows app version, first seen, events, users, builds, and updates. JSON output returns the full hierarchy, with EAS Build and update details nested under each version.
常用工作流程
🌐 Common workflows
将当前版本与上一个版本进行比较:
寻找并调查最慢的启动:
检查哪些屏幕最慢变得可交互:
查看空中下载更新在现场的情况:
在指标上设置脚本或 CI 任务的门控: