docs(config): add end-to-end PlayCover (macOS) example - #573
Conversation
The [connection] docs mention the PlayCover special preset but never show the PlayTools address (localhost:1717), the prerequisite that the game and MaaTools must be running first, or a full task-chain example. New macOS users hit "Unknown connection preset" / ADB-fallback failures as a result. Add a copy-pasteable connection block plus a StartUp -> Roguelike -> CloseDown task file, in both en-US and zh-CN. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
嗨——我发现了 1 个问题,并给出了一些总体反馈:
- 在两个语言版本中,建议在周围的说明文字中统一使用
macOS(而不是MacOS),以符合苹果的品牌用法以及其余文档中的写法。 - 关于 ADB 回退的先决条件说明,可以简要补充:当发生回退时,用户应在日志中关注什么内容,或常见的症状是什么,这样他们就能更容易判断自己是否错误配置了 PlayTools/MaaTools 端口。
给 AI Agent 的提示
请根据这次代码评审中的评论进行修改:
## 总体评论
- 在两个语言版本中,建议在周围的说明文字中统一使用 `macOS`(而不是 `MacOS`),以符合苹果的品牌用法以及其余文档中的写法。
- 关于 ADB 回退的先决条件说明,可以简要补充:当发生回退时,用户应在日志中关注什么内容,或常见的症状是什么,这样他们就能更容易判断自己是否错误配置了 PlayTools/MaaTools 端口。
## 单条评论
### 评论 1
<location path="crates/maa-cli/docs/en-US/config.md" line_range="363" />
<code_context>
+ > a `StartUp` task sets `start_game_enabled = true`.
+
+ A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs
+ the Sami roguelike, then closes it looks like:
+
+ ```toml
</code_context>
<issue_to_address>
**suggestion (typo):** 收紧短语 "then closes it looks like" 的语法。
可以考虑重新表述这句话以改善行文流畅度,例如:"... then closes it, looks like this:" 或 "... then closes it, as follows:"。
建议的实现方式:
```
A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs the Sami roguelike, then closes it is as follows:
```
如果这句话当前被拆分成多行(例如在 "runs" 或 "the Sami roguelike" 之后换行),请调整 SEARCH 块以匹配完整的多行文本,并应用同样的措辞修改,使整句变为:
"A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs the Sami roguelike, then closes it is as follows:"
</issue_to_address>帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- In both locales, consider consistently using
macOS(rather thanMacOS) in the surrounding prose to match Apple’s branding and the rest of the docs. - The prerequisite note about ADB fallback could briefly clarify what users should look for in logs or common symptoms when the fallback happens, so they can more easily recognize they’ve misconfigured the PlayTools/MaaTools port.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In both locales, consider consistently using `macOS` (rather than `MacOS`) in the surrounding prose to match Apple’s branding and the rest of the docs.
- The prerequisite note about ADB fallback could briefly clarify what users should look for in logs or common symptoms when the fallback happens, so they can more easily recognize they’ve misconfigured the PlayTools/MaaTools port.
## Individual Comments
### Comment 1
<location path="crates/maa-cli/docs/en-US/config.md" line_range="363" />
<code_context>
+ > a `StartUp` task sets `start_game_enabled = true`.
+
+ A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs
+ the Sami roguelike, then closes it looks like:
+
+ ```toml
</code_context>
<issue_to_address>
**suggestion (typo):** Tighten the grammar in the phrase "then closes it looks like".
Consider rephrasing the sentence to improve flow, e.g. "... then closes it, looks like this:" or "... then closes it, as follows:".
Suggested implementation:
```
A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs the Sami roguelike, then closes it is as follows:
```
If the sentence is currently wrapped across multiple lines (for example, with a line break after "runs" or "the Sami roguelike"), adjust the SEARCH block to match the exact multiline text and apply the same wording change so that the full sentence reads:
"A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs the Sami roguelike, then closes it is as follows:"
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| > a `StartUp` task sets `start_game_enabled = true`. | ||
|
|
||
| A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs | ||
| the Sami roguelike, then closes it looks like: |
There was a problem hiding this comment.
suggestion (typo): 收紧短语 "then closes it looks like" 的语法。
可以考虑重新表述这句话以改善行文流畅度,例如:"... then closes it, looks like this:" 或 "... then closes it, as follows:"。
建议的实现方式:
A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs the Sami roguelike, then closes it is as follows:
如果这句话当前被拆分成多行(例如在 "runs" 或 "the Sami roguelike" 之后换行),请调整 SEARCH 块以匹配完整的多行文本,并应用同样的措辞修改,使整句变为:
"A complete task file ($MAA_CONFIG_DIR/tasks/daily.toml) that starts the game, runs the Sami roguelike, then closes it is as follows:"
Original comment in English
suggestion (typo): Tighten the grammar in the phrase "then closes it looks like".
Consider rephrasing the sentence to improve flow, e.g. "... then closes it, looks like this:" or "... then closes it, as follows:".
Suggested implementation:
A complete task file (`$MAA_CONFIG_DIR/tasks/daily.toml`) that starts the game, runs the Sami roguelike, then closes it is as follows:
If the sentence is currently wrapped across multiple lines (for example, with a line break after "runs" or "the Sami roguelike"), adjust the SEARCH block to match the exact multiline text and apply the same wording change so that the full sentence reads:
"A complete task file ($MAA_CONFIG_DIR/tasks/daily.toml) that starts the game, runs the Sami roguelike, then closes it is as follows:"
There was a problem hiding this comment.
Pull request overview
This PR improves the maa-cli configuration documentation by expanding the “PlayCover (macOS)” special preset section so macOS users can copy/paste a complete, runnable example and understand the required prerequisites before connecting.
Changes:
- Add a copy-pasteable
[connection]example forpreset = "PlayCover"with an explicit PlayTools/MaaTools address. - Add prerequisite notes clarifying that MaaTools must be listening before
maa-cliconnects (and thatStartUpcan launch the app when configured). - Add an end-to-end task-chain example (
StartUp -> Roguelike -> CloseDown) plus amaa run dailyinvocation in both English and Chinese docs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/maa-cli/docs/en-US/config.md | Expands the PlayCover special preset section with address + prerequisite guidance and a full task-chain example. |
| crates/maa-cli/docs/zh-CN/config.md | Adds the same PlayCover address/prerequisite + end-to-end runnable task-chain example in Simplified Chinese. |
Suppressed comments (2)
crates/maa-cli/docs/en-US/config.md:360
- The note says the connection “falls back to ADB and fails” when MaaTools isn’t listening. In maa-cli config parsing, “fallback to ADB” happens when the preset name is unknown (it logs a warning and uses
Adb), not whenPreset::PlayCoveris selected but PlayTools is offline. Reword this to avoid implying an automatic ADB fallback in the PlayCover preset case.
> **Prerequisite:** the game must already be running under PlayCover with MaaTools
> enabled and listening (default port `1717`) before maa-cli connects; otherwise the
> connection falls back to ADB and fails. maa-cli can also launch the app for you when
> a `StartUp` task sets `start_game_enabled = true`.
crates/maa-cli/docs/zh-CN/config.md:343
- “否则连接会回退到 ADB 并失败”这句表述容易误导:在 maa-cli 里,回退到
ADB是因为preset值无法识别时会被解析成Adb(并打印 warning),而不是PlayCover预设在 PlayTools 未监听时自动回退。建议改为“无法连接到 PlayTools”,并可补充“preset 写错会被当作 ADB”。
> **前置条件**:在 maa-cli 连接之前,游戏必须已在 PlayCover 中运行并启用 MaaTools 监听端口(默认 `1717`),否则连接会回退到 ADB 并失败。若 `StartUp` 任务设置了 `start_game_enabled = true`,maa-cli 也可以替你启动游戏。
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `PlayCover` 用于在 macOS 上连接直接通过 `PlayCover` 原生运行的游戏客户端。这种情况下不需要指定 `adb_path`,`address` 不是 `adb` 连接的地址,而是 `PlayTools` 的地址(在 PlayCover 中配置的 MaaTools 端口,默认 `localhost:1717`): | ||
|
|
||
| ```toml | ||
| [connection] | ||
| preset = "PlayCover" | ||
| address = "localhost:1717" | ||
| ``` |
|
|
||
| > **Prerequisite:** the game must already be running under PlayCover with MaaTools | ||
| > enabled and listening (default port `1717`) before maa-cli connects; otherwise the | ||
| > connection falls back to ADB and fails. maa-cli can also launch the app for you when |
There was a problem hiding this comment.
这个有点不太准确,maa 并不会 fallback 成 ADB,而是直接连接失败。
What
The
[connection]docs mention thePlayCoverspecial preset but never show:localhost:1717),New macOS users therefore hit
Unknown connection preset(from copying the rendered labelPlayCover (macOS)verbatim) or ADB-fallback connection failures, with nothing runnable to copy.Change
Expand the
PlayCoverspecial-preset entry in bothen-US/config.mdandzh-CN/config.mdwith:[connection]block (preset = "PlayCover",address = "localhost:1717").1717first;StartUpcan launch it).StartUp -> Roguelike -> CloseDowntask file plusmaa run daily.Docs-only.
markdownlint-cli2 --config .markdownlint.yamlpasses on both files.Summary by Sourcery
在 maa-cli 配置文档中补充有关 PlayCover(macOS)连接用法的说明,并提供一个可直接复制粘贴的完整示例工作流。
Documentation:
Original summary in English
Summary by Sourcery
Document PlayCover (macOS) connection usage in maa-cli configuration docs with a complete, copy-pasteable example workflow.
Documentation: