Skip to content

ConnectionRefusedError: [Errno 61] Connection refused #31

@yfyang919

Description

@yfyang919

[2025-02-14 14:18:32] hdc.py[line: 23] [DEBUG] hdc list targets
[2025-02-14 14:18:32] _client.py[line: 143] [INFO] Start HmClient connection
[2025-02-14 14:18:32] _client.py[line: 172] [DEBUG] init the agent.so resource on the device.
[2025-02-14 14:18:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 shell [ -f /data/local/tmp/agent.so ] && echo 'so exists' || echo 'so not exists'
[2025-02-14 14:18:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 shell md5sum /data/local/tmp/agent.so
[2025-02-14 14:18:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 file send /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hmdriver2/assets/uitest_agent_v1.1.0.so /data/local/tmp/agent.so
[2025-02-14 14:18:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 shell chmod +x /data/local/tmp/agent.so
[2025-02-14 14:18:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 shell ps -ef
[2025-02-14 14:18:32] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 shell uitest start-daemon singleness
[2025-02-14 14:18:33] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 fport ls
[2025-02-14 14:18:33] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 fport tcp:10000 tcp:8012
Traceback (most recent call last):
File "testAirCv.py", line 11, in
d = Driver(serialNo)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hmdriver2/driver.py", line 24, in init
self._init_hmclient()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hmdriver2/driver.py", line 43, in _init_hmclient
self._client.start()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hmdriver2/_client.py", line 147, in start
self._connect_sock()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hmdriver2/_client.py", line 44, in _connect_sock
self.sock.connect((("127.0.0.1", self.local_port)))
ConnectionRefusedError: [Errno 61] Connection refused
[2025-02-14 14:18:33] _client.py[line: 152] [INFO] Release HmClient connection
[2025-02-14 14:18:33] _client.py[line: 37] [DEBUG] rm fport local port
[2025-02-14 14:18:33] hdc.py[line: 23] [DEBUG] hdc -t FMR0224125012954 fport rm tcp:10000 tcp:8012

尝试重新打开开发者选项,重启手机,都是提示这个错误。
但是通过DevEco Testing 链接手机后,再回来执行脚本就正常了。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions