Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window没有兼容,安装hap包的链接判断有问题,以及测试结束后with d.screenrecord.start("test2.mp4"): 方法一直运行,没有自动stop清理资源暂停掉 #15

Open
xiahehe2020 opened this issue Dec 3, 2024 · 8 comments

Comments

@xiahehe2020
Copy link

No description provided.

@codematrixer
Copy link
Owner

把两个问题的日志都贴一下呢

@xiahehe2020
Copy link
Author

1

[2024-12-04 21:01:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0223915002007 install 'D:\Users\jiexia\Ctrip.hap' 这句代码执行的时候安装不了包因为多了单引号在window上不行,但是命令行单独执行是OK的

@xiahehe2020
Copy link
Author

2
在window上with一直不能stop清理资源,日志只有下面这些,但是如果debug运行又是好的,run的时候不行
[2024-12-04 21:08:48] hdc.py[line: 23] [DEBUG] hdc -t FMR0223915002007 fport rm tcp:10004 tcp:8012
None
走到这里了
[2024-12-04 21:08:48] _client.py[line: 152] [INFO] Release HmClient connection
[2024-12-04 21:08:48] _client.py[line: 37] [DEBUG] rm fport local port
[2024-12-04 21:08:48] hdc.py[line: 23] [DEBUG] hdc -t FMR0223915002007 fport rm tcp:10003 tcp:8012

但是如果在hdc.py文件73行后加入
import time
time.sleep(0.5)
就会神奇的好了,感觉是下面一行代码在window上兼容性问题
3

@codematrixer
Copy link
Owner

1

[2024-12-04 21:01:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0223915002007 install 'D:\Users\jiexia\Ctrip.hap' 这句代码执行的时候安装不了包因为多了单引号在window上不行,但是命令行单独执行是OK的

这个问题我好像修复过,你是用的最新版本的hmdriver2么

@xiahehe2020
Copy link
Author

1
[2024-12-04 21:01:32] hdc.py [line: 23] [DEBUG] hdc -t FMR0223915002007 install 'D:\Users\jiexia\Ctrip.hap' 这句代码执行的时候安装不了包因为多了单引号在window上不行,但是命令行单独执行是OK的

这个问题我希望修复过,你用的是最新版本的hmdriver2么

是的最新版本,1.3.1版本
Name: hmdriver2
Version: 1.3.1
Summary: UI Automation Framework for Harmony Next
Home-page:
Author: codematrixer
Author-email: [email protected]

@codematrixer
Copy link
Owner

codematrixer commented Dec 5, 2024

@xiahehe2020 我没有windows,可否帮我测试下,将hdc里的install方法中quoted_path改成如下这个形式:

    def install(self, apkpath: str):
        # Ensure the path is properly quoted for Windows
        quoted_path = f'"{apkpath}"'

        result = _execute_command(f"hdc -t {self.serial} install {quoted_path}")
        if result.exit_code != 0:
            raise HdcError("HDC install error", result.error)
        return result

@xiahehe2020
Copy link
Author

@xiahehe2020我没有windows,可否帮我测试下,将hdc里的install方法中的quoted_pa​​th改成如下形式:

    def install(self, apkpath: str):
        # Ensure the path is properly quoted for Windows
        quoted_path = f'"{apkpath}"'

        result = _execute_command(f"hdc -t {self.serial} install {quoted_path}")
        if result.exit_code != 0:
            raise HdcError("HDC install error", result.error)
        return result

在window上试了 是可以的👍
大神,录屏window上不能停止清理资源有头绪吗?

@codematrixer
Copy link
Owner

codematrixer commented Dec 5, 2024

@xiahehe2020我没有windows,可否帮我测试下,将hdc里的install方法中的quoted_pa​​th改成如下形式:

    def install(self, apkpath: str):
        # Ensure the path is properly quoted for Windows
        quoted_path = f'"{apkpath}"'

        result = _execute_command(f"hdc -t {self.serial} install {quoted_path}")
        if result.exit_code != 0:
            raise HdcError("HDC install error", result.error)
        return result

在window上试了 是可以的👍 大神,录屏window上不能停止清理资源有头绪吗?

录屏这个,看你描述的,确实没啥头绪,改天我用Windows试试吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants