MaaAssistantArknights / MaaAssistantArknights/maa-cli

连接失败 - adb 相关

Open
#544 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
117
Forks
39
PR merge metrics
No merged PRs in 30d

Description

在我的macOS上,任何maa-cli的具体任务都会卡在日志输出一下字段后

```bash
[2026-05-07 00:32:20 DEBUG] Connecting to cab5aaea with config CompatMac via /Users/Sakiko/adb/adb
[2026-05-07 00:32:20 DEBUG] Got UUID: 11111111
[2026-05-07 00:32:20 DEBUG] Got Resolution: 1280 × 720
[2026-05-07 00:32:20 INFO ] Connected
```

在问题发生前,我尝试用gnirehtet为安卓设备提供网络。gnirehtet和maa-cli同时运行时,也出现了此问题。但卡住后任意时刻Ctrl+C中断gnirehtet后maa-cli正常工作。此时继续使用gnirehtet不会影响maa-cli。再后来通过其他方式提供网络后卸载了gnirehtet。此问题确仍然存在。即使我重新安装gnirehtet重复之前的操作。

## maa-cli环境

```bash
Sakiko ~ > maa version
maa-cli v0.7.4
MaaCore v6.9.2
Sakiko ~ > maa self update
✔ Fetched version manifest, already up-to-date!
nan ~ > maa update
✔ Fetched version manifest, already up-to-date!
Already up to date.
Sakiko ~ > maa dir data
/Users/Sakiko/Library/Application Support/com.loong.maa
Sakiko ~ > maa dir resource
/Users/Sakiko/Library/Application Support/com.loong.maa/resource
Sakiko ~ > maa dir hot-update
/Users/Sakiko/Library/Application Support/com.loong.maa/MaaResource
Sakiko ~ > maa dir config
/Users/Sakiko/Library/Application Support/com.loong.maa/config
Sakiko ~ > cat '/Users/Sakiko/Library/Application Support/com.loong.maa/config/profiles/default.json'
{
"connection": {
"preset": "ADB",
"adb_path": "/Users/Sakiko/adb/adb",
"address": "cab5aaea"
},
"instance_options": {
"touch_mode": "MaaTouch",
"deployment_with_pause": false,
"adb_lite_enabled": false,
"kill_adb_on_exit": true
}
}
```

我通过cargo安装

## 外部因素确认

通过adb可以启动粥,我认为不应该是adb的问题:

```bash
adb shell am start -n com.hypergryph.arknights/com.u8.sdk.U8UnityContext
```

理论上不是maa-cli的问题,参考以下日志,但maa-cli对资源管理地不完善可能导致了此问题。

[maa.log](https://github.com/user-attachments/files/27449292/maa.log)

个人能力有限,只知道[2026-05-07 00:32:20 INFO ] Connected是maa core发出的。但没法定位到具体代码。**强烈推荐贵项目尝试[tokio tracing](https://github.com/tokio-rs/tracing)的span等同类技术优化日志输出,理论上会方便很多。**

如果有人能告知maa core 相关业务代码位置,我也想试试自己定位问题。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the hang with the shown default.json connection settings and the attached maa.log, then compare behavior before and after stopping gnirehtet. Trace the MaaCore path that emits the “Connected” message and examine the ADB connection flow. Done means identifying the cause of the post-connection stall and documenting or fixing it with a reproducible check.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
cli, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.