Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e34ca32
feat: Support x86 emulator
yabi-zzh Apr 15, 2025
702d064
feat: Add press_keys and go_recent
yabi-zzh Apr 15, 2025
f6975e0
feat: Add message framing using protocol headers (HEADER_BYTES and TR…
yabi-zzh Apr 21, 2025
b413f4e
refactor: Remove unused buff_size parameter
yabi-zzh Apr 21, 2025
35eee03
Update README.md
yabi-zzh Jun 14, 2025
6128175
feat: 支持xpath获取其他属性、优化部分代码及注释
yabi-zzh Jun 15, 2025
3752182
feat: 实现控件查找正则匹配功能
yabi-zzh Sep 16, 2025
c2dba0d
fix: 修复端口转发清理问题
yabi-zzh Sep 23, 2025
8fb542b
feat: 实现 WebView 自动化测试 和 ChromeDriver 版本适配
yabi-zzh Sep 24, 2025
61497e9
docs: 更新 README.md
yabi-zzh Sep 24, 2025
e51a67c
refactor: 优化端口分配并去除冗余命令,显著提升启动速度
yabi-zzh Sep 24, 2025
a332b44
fix: 修复current_app获取、优化部分hdc命令
yabi-zzh Sep 29, 2025
480363a
chore: 添加自动化安装脚本和文档,升级版本到1.5.1
yabi-zzh Sep 29, 2025
33f6d49
fix: 修复因正则功能引起的查找问题
yabi-zzh Oct 11, 2025
3b45e99
chore: 升级agent.so版本,修改proto.py适配最新so
yabi-zzh Oct 11, 2025
a426627
chore: 提升版本到1.5.3
yabi-zzh Oct 11, 2025
8b64d53
fix: 修复 screen_off 逻辑错误和 FreePort 资源泄漏问题
yabi-zzh Oct 29, 2025
a7aa842
perf: 优化元素属性访问性能,使用属性缓存机制
yabi-zzh Oct 29, 2025
3303274
chore: 提升版本到1.5.4
yabi-zzh Oct 29, 2025
17534c8
fix: 修复动态 Session ID 导致的协议响应格式异常
yabi-zzh Oct 30, 2025
77def4d
fix: 修复 send_key 方法中命令参数问题
yabi-zzh Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions hmdriver2/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ def init(self):
time.sleep(0.5)

def _get_local_agent_path(self) -> str:
"""Return the local path of the agent file."""
target_agent = "uitest_agent_v1.1.0.so"
"""Return the local path of the agent file, based on the cpu_abi version (e.g., 'so/arm64-v8a/agent.so')."""
cpu_abi = self.hdc.cpu_abi()

target_agent = os.path.join("so", cpu_abi, "agent.so")
return os.path.join(os.path.dirname(os.path.realpath(__file__)), "assets", target_agent)

def _get_remote_md5sum(self, file_path: str) -> Optional[str]:
Expand Down
Binary file added hmdriver2/assets/so/arm64-v8a/agent.so
Binary file not shown.
Binary file added hmdriver2/assets/so/x86_64/agent.so
Binary file not shown.
Binary file removed hmdriver2/assets/uitest_agent_v1.0.7.so
Binary file not shown.
Binary file removed hmdriver2/assets/uitest_agent_v1.1.0.so
Binary file not shown.
13 changes: 13 additions & 0 deletions hmdriver2/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,23 @@ def go_back(self):
def go_home(self):
self.hdc.send_key(KeyCode.HOME)

@delay
def go_recent(self):
self.press_keys(KeyCode.META_LEFT, KeyCode.TAB)

@delay
def press_key(self, key_code: Union[KeyCode, int]):
self.hdc.send_key(key_code)

@delay
def press_keys(self, key_code1: Union[KeyCode, int], key_code2: Union[KeyCode, int]):
"""Press two keys in sequence, given their integer key codes."""
code1 = key_code1.value if isinstance(key_code1, KeyCode) else key_code1
code2 = key_code2.value if isinstance(key_code2, KeyCode) else key_code2

api = "Driver.triggerCombineKeys"
self._invoke(api, args=[code1, code2])

def screen_on(self):
self.hdc.wakeup()

Expand Down