MFABD2 icon indicating copy to clipboard operation
MFABD2 copied to clipboard

关于linux的相关设置

Open bhzhao19 opened this issue 4 months ago • 1 comments

说说你遇到的问题?

阅读文档和项目后,稍有些困惑,不知道linux的zip文件应该如何配置(也是依赖于wine或者waydroid等方式么?)

bhzhao19 avatar Jul 26 '26 17:07 bhzhao19

Linux 包不需要 wine,它就是原生 Linux 构建:MFAAvalonia(GUI 前端)+ libMaaFramework.so + 随包内置的 standalone Python 运行时。解压后 chmod +x MFAAvalonia && ./MFAAvalonia 就能起来。.zip 只是打包格式,跟 Windows 包没有区别。

需要澄清的是这个软件的定位:它只是一个控制端,游戏不在它里面跑。它通过 ADB 去操作另一头的安卓设备,所以真正要决定的是「被控的安卓在哪」:

  • 局域网内另一台机器上的模拟器(Windows 上的 MuMu / 雷电等)—— 开模拟器的网络 ADB,从 Linux 端 adb connect 过去。这是我推荐的方案。
  • 本机的 Waydroid / Genymotion —— 只要能被 adb connect 上,理论上可行,但没有测试过。分辨率、截图兼容性、性能都得自己折腾,出问题不保证能支持。
  • 安卓真机 / 云手机 —— 能用,但提醒一句:延迟很高。ADB 截图走 USB、尤其是走 Wi-Fi,比本地模拟器慢得多。每一步识别都要等一张截图,整轮跑下来可能是几倍的耗时,对时序敏感的节点也更容易误判。可用,但不舒服。有条件的话还是优先用模拟器。

另外两点:

  1. Linux 包里没有自带 adb,需要自己装(apt install android-tools-adb、pacman -S android-tools 等),然后在软件里指定 adb 路径和设备地址。
  2. interface.json 里的 PC客户端 是 Win32 控制器,直接操作 Windows 窗口,Linux 下用不了,只能选 ADB 控制器(安卓模拟器)。想用 wine 跑 PC 版游戏、再用 Win32 控制器去点它,这条路走不通。

简单说:Linux 端负责跑 UI 和逻辑,被控设备通过 ADB 自己接,跟 wine 没关系。


The Linux zip does not need wine. It's a native Linux build — MFAAvalonia (the GUI frontend) + libMaaFramework.so + a bundled standalone Python runtime. Just unzip it, chmod +x MFAAvalonia && ./MFAAvalonia, and it runs. The .zip is only a container format, same as the Windows package.

The thing worth clarifying is what this software actually is: it's only a controller. The game does not run inside it. It drives an Android device over ADB, so the real question is where that Android instance lives:

  • An Android emulator on another machine in your LAN (MuMu / LDPlayer on a Windows box, etc.) — enable the emulator's network ADB and adb connect to it from Linux. This is the setup I'd recommend.
  • Waydroid / Genymotion on the same Linux machine — should work in theory as long as adb connect reaches it, but it's untested. Resolution, screencap compatibility and performance are all on you, and I can't promise support if something breaks.
  • A physical phone or a cloud phone — works, but be warned: latency is significant. ADB screencap over USB, and especially over Wi-Fi, is much slower than against a local emulator. Every recognition step waits on a screenshot, so a full run can take several times longer, and timing-sensitive nodes are more likely to misfire. It's usable, not pleasant. An emulator is the better target if you have the option.

Two more things:

  1. The Linux package does not bundle adb. Install it yourself (apt install android-tools-adb, pacman -S android-tools, …), then point the app at the adb binary and your device address.
  2. The PC客户端 controller in interface.json is a Win32 controller — it manipulates Windows windows directly, so it does not work on Linux. Only the ADB controller (安卓模拟器) is available. Running the PC version of the game under wine and driving it with the Win32 controller is not a viable path.

In short: the Linux build runs the UI and the logic; what it controls is up to you to attach over ADB. wine is not part of the picture.

sunyink avatar Jul 28 '26 03:07 sunyink