Skip to content

连接失败 - adb 相关 #544

Description

@nan-mu

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

[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环境

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的问题:

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

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

maa.log

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

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

Activity

  1. nan-mu commented on May 6, 2026

    @nan-mu
    Author

    在OrbStack虚拟机里通过连接外部adb守护进程成功启动了maa-cli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions