Repository navigation
fix(emulator): support MuMu Android 15 instance startup - #1792
Conversation
There was a problem hiding this comment.
您好——我发现了 1 个问题
AI 代理提示
请处理本次代码审查中的评论:
## 单独评论
### 评论 1
<location path="module/device/platform2/emulator_base.py" line_range="100-107" />
<code_context>
Convert MuMu 12 instance name to instance id.
Example names:
MuMuPlayer-12.0-3
+ MuMuPlayerGlobal-15.0-1
YXArkNights-12.0-1
Returns:
int: Instance ID, or None if this is not a MuMu 12 instance
"""
- res = re.search(r'MuMuPlayer(?:Global)?-12.0-(\d+)', self.name)
+ res = re.search(r'MuMuPlayer(?:Global)?-(?:12|15)\.0-(\d+)', self.name)
</code_context>
<issue_to_address>
**小问题:** 文档字符串仍然描述 `MuMuPlayer12_id` 仅将 MuMu 12 名称转换为实例 ID,并且对于非 MuMu 12 实例返回 `None`,但当前实现现在也会为 MuMu Android 15 名称返回 ID。
**建议修复:** 更新文档字符串,以说明 MuMu 12 和 15 名称以及新的返回行为。
```suggestion
Convert MuMu 12 or 15 instance name to instance id.
Example names:
MuMuPlayer-12.0-3
MuMuPlayerGlobal-15.0-1
YXArkNights-12.0-1
Returns:
int: Instance ID, or None if this is not a MuMu 12 or 15 instance
```
</issue_to_address>Sourcery 评估
已批准。
Original comment in English
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="module/device/platform2/emulator_base.py" line_range="100-107" />
<code_context>
Convert MuMu 12 instance name to instance id.
Example names:
MuMuPlayer-12.0-3
+ MuMuPlayerGlobal-15.0-1
YXArkNights-12.0-1
Returns:
int: Instance ID, or None if this is not a MuMu 12 instance
"""
- res = re.search(r'MuMuPlayer(?:Global)?-12.0-(\d+)', self.name)
+ res = re.search(r'MuMuPlayer(?:Global)?-(?:12|15)\.0-(\d+)', self.name)
</code_context>
<issue_to_address>
**nitpick:** The docstring still describes `MuMuPlayer12_id` as converting only MuMu 12 names and returning `None` for non-MuMu-12 instances, but the implementation now returns an ID for MuMu Android 15 names.
**Suggested fix:** Update the docstring to describe MuMu 12 and 15 names and the new return behavior.
```suggestion
Convert MuMu 12 or 15 instance name to instance id.
Example names:
MuMuPlayer-12.0-3
MuMuPlayerGlobal-15.0-1
YXArkNights-12.0-1
Returns:
int: Instance ID, or None if this is not a MuMu 12 or 15 instance
```
</issue_to_address>Sourcery assessment
Approved.
| Convert MuMu 12 instance name to instance id. | ||
| Example names: | ||
| MuMuPlayer-12.0-3 | ||
| MuMuPlayerGlobal-15.0-1 | ||
| YXArkNights-12.0-1 | ||
|
|
||
| Returns: | ||
| int: Instance ID, or None if this is not a MuMu 12 instance |
There was a problem hiding this comment.
小问题: 文档字符串仍然描述 MuMuPlayer12_id 仅将 MuMu 12 名称转换为实例 ID,并且对于非 MuMu 12 实例返回 None,但当前实现现在也会为 MuMu Android 15 名称返回 ID。
建议修复: 更新文档字符串,以说明 MuMu 12 和 15 名称以及新的返回行为。
| Convert MuMu 12 instance name to instance id. | |
| Example names: | |
| MuMuPlayer-12.0-3 | |
| MuMuPlayerGlobal-15.0-1 | |
| YXArkNights-12.0-1 | |
| Returns: | |
| int: Instance ID, or None if this is not a MuMu 12 instance | |
| Convert MuMu 12 or 15 instance name to instance id. | |
| Example names: | |
| MuMuPlayer-12.0-3 | |
| MuMuPlayerGlobal-15.0-1 | |
| YXArkNights-12.0-1 | |
| Returns: | |
| int: Instance ID, or None if this is not a MuMu 12 or 15 instance |
Original comment in English
nitpick: The docstring still describes MuMuPlayer12_id as converting only MuMu 12 names and returning None for non-MuMu-12 instances, but the implementation now returns an ID for MuMu Android 15 names.
Suggested fix: Update the docstring to describe MuMu 12 and 15 names and the new return behavior.
| Convert MuMu 12 instance name to instance id. | |
| Example names: | |
| MuMuPlayer-12.0-3 | |
| MuMuPlayerGlobal-15.0-1 | |
| YXArkNights-12.0-1 | |
| Returns: | |
| int: Instance ID, or None if this is not a MuMu 12 instance | |
| Convert MuMu 12 or 15 instance name to instance id. | |
| Example names: | |
| MuMuPlayer-12.0-3 | |
| MuMuPlayerGlobal-15.0-1 | |
| YXArkNights-12.0-1 | |
| Returns: | |
| int: Instance ID, or None if this is not a MuMu 12 or 15 instance |
Findings
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "ab.chatgpt.com"See Network Configuration for more information.
|
Change Summary
Reconstructed Intent点击此处展开- 这次改动最可能是为了让调度器能够从已发现的 MuMu Android 15 实例名称中提取正确索引,并通过新版本管理器命令真正启动目标实例,而不是只打开管理器。 - 停止阶段等待命令完成,意图是避免同一实例的 shutdown 与下一次 launch 重叠。Observed Constraints点击此处展开- 实例发现必须产出形如 `MuMuPlayer[-Global]-15.0-<数字>` 的名称,且索引必须与 MuMuManager 的 `-v` 参数一致。 - Android 15 必须使用 `MuMuManager.exe` 的 `control` 子命令并显式传入 `--version 15`;旧版本仍依赖原有 `-v`/`api` 命令。 - 启动流程本身会先 stop 再 start,因此 Android 15 的 stop 命令必须在可接受时间内返回;当前实现将等待上限固定为 30 秒。Intent Alignment
Release Risk
Validation Gaps点击此处展开- PR 描述提到离线 parser/command 回归,但当前 diff 未包含测试文件或自动化测试;无法从变更本身确认这些用例已进入 CI。 - 需要至少覆盖:Global 与非 Global、索引 0、多实例索引、Malformed/未知版本名称,以及 stop 超时和非零退出场景。 - 需要在 MuMu Android 15 的冷启动、已运行实例、慢关机后重启场景确认 ADB 连接最终稳定;同时确认 Android 12 与 YXArkNights 的原命令行为未回归。Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "ab.chatgpt.com"See Network Configuration for more information.
|
MuMu Android 15 instances cannot be launched automatically: their names do not match the 12.0-only ID parser, and the current MuMu manager uses
controlrather than the legacy launcher/API commands. OAS consequently opens the manager without starting the requested instance.Recognize 15.0 instance names and use
MuMuManager.exe control -v <id> --version 15 launch/shutdownfor those instances. Wait for the shutdown command to finish before launching to avoid overlapping requests. Existing Android 12 and YXArkNights behavior is preserved.Validation:
git diff --checkpasses.Live verification: MuMu Global 6.5.6.0 / Android 15 on Windows. Starting the existing OAS scheduler from a stopped instance completed emulator startup and established ADB connectivity. The scheduler was left running. Android 12 command compatibility was checked offline only. No account configuration, device logs or recordings are included.
Sourcery 摘要
为 MuMu Android 15 实例实现可靠的自动生命周期管理。
新功能:
错误修复:
增强功能:
测试:
Original summary in English
Summary by Sourcery
Enable reliable automatic lifecycle management for MuMu Android 15 instances.
New Features:
Bug Fixes:
Enhancements:
Tests: