Skip to content

docs(config): add end-to-end PlayCover (macOS) example - #573

Open
tic-top wants to merge 1 commit into
MaaAssistantArknights:mainfrom
tic-top:docs/playcover-macos-example
Open

docs(config): add end-to-end PlayCover (macOS) example#573
tic-top wants to merge 1 commit into
MaaAssistantArknights:mainfrom
tic-top:docs/playcover-macos-example

Conversation

@tic-top

@tic-top tic-top commented Aug 4, 2026

Copy link
Copy Markdown

What

The [connection] docs mention the PlayCover special preset but never show:

  • the PlayTools address (localhost:1717),
  • the prerequisite that the game / MaaTools must already be running before maa-cli connects, and
  • a full task-chain example wiring the connection to actual tasks.

New macOS users therefore hit Unknown connection preset (from copying the rendered label PlayCover (macOS) verbatim) or ADB-fallback connection failures, with nothing runnable to copy.

Change

Expand the PlayCover special-preset entry in both en-US/config.md and zh-CN/config.md with:

  1. A copy-pasteable [connection] block (preset = "PlayCover", address = "localhost:1717").
  2. A prerequisite note (game + MaaTools listening on 1717 first; StartUp can launch it).
  3. A complete StartUp -> Roguelike -> CloseDown task file plus maa run daily.

Docs-only. markdownlint-cli2 --config .markdownlint.yaml passes on both files.

Summary by Sourcery

在 maa-cli 配置文档中补充有关 PlayCover(macOS)连接用法的说明,并提供一个可直接复制粘贴的完整示例工作流。

Documentation:

  • 在英文配置文档中添加明确的 PlayCover 预设连接示例,包含 PlayTools 默认地址及前置条件说明。
  • 在中文配置文档中添加本地化的 PlayCover 预设连接与任务链示例,包括启动、肉鸽(roguelike)以及关闭任务。
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:

  • Add explicit PlayCover preset connection example with PlayTools default address and prerequisite notes to the English config documentation.
  • Add a localized PlayCover preset connection and task-chain example, including startup, roguelike, and shutdown tasks, to the Chinese config documentation.

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>
Copilot AI lite review requested due to automatic review settings August 4, 2026 09:56

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗨——我发现了 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>

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • 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.
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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for preset = "PlayCover" with an explicit PlayTools/MaaTools address.
  • Add prerequisite notes clarifying that MaaTools must be listening before maa-cli connects (and that StartUp can launch the app when configured).
  • Add an end-to-end task-chain example (StartUp -> Roguelike -> CloseDown) plus a maa run daily invocation 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 when Preset::PlayCover is 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.

Comment thread crates/maa-cli/docs/en-US/config.md
Comment on lines +335 to +341
- `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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个有点不太准确,maa 并不会 fallback 成 ADB,而是直接连接失败。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants