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

poco没有展示unity游戏的元素树,termial报错“Address already in use\nError creating socket: Address already in use\n'” #211

Closed
wodesenlin opened this issue Jun 11, 2019 · 3 comments

Comments

@wodesenlin
Copy link

Remove any following parts if does not have details about

Describe the bug

AirtestIDE启动后,连接到ios的游戏界面,poco没有展示unity游戏到元素树

initializing Unity poco.
[rpc]connected
[Errno 54] Connection reset by peer
[Errno 32] Broken pipe
Traceback (most recent call last):
  File "/Users/wjjn3033/dev/idestable/airtest-ide/app/plugins/poco/poco_probe.py", line 111, in close
  File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/rpcclient.py", line 44, in close
    self.conn.close()
  File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/transport/tcp/main.py", line 43, in close
    self.c.close()
  File "/Applications/AirtestIDE.app/Contents/MacOS/poco/utils/simplerpc/transport/tcp/safetcp.py", line 72, in close
    self.sock.shutdown(socket.SHUT_RDWR)
OSError: [Errno 57] Socket is not connected
Traceback (most recent call last):
  File "/Users/wjjn3033/dev/idestable/airtest-ide/app/plugins/poco/poco_probe.py", line 82, in initPoco
  File "/Applications/AirtestIDE.app/Contents/MacOS/airtest/core/ios/instruct_helper.py", line 67, in do_proxy
    raise AirtestError((stdout, stderr))
airtest.core.error.AirtestError: ('', 'bind(): Address already in use\nError creating socket: Address already in use\n')

To Reproduce
Steps to reproduce the behaviour:

  1. 参考以下链接的步骤,用Mac连接ipad(ios10.2)
    http://airtest.netease.com/docs/cn/2_device_connection/4_ios_connection.html
  2. WebDriverAgentRunner 提示连接ipd成功
2019-06-11 13:34:40.101645 WebDriverAgentRunner-Runner[512:72792] Continuing to run tests in the background with task ID 1
Test Suite 'All tests' started at 2019-06-11 13:34:40.917
Test Suite 'WebDriverAgentRunner.xctest' started at 2019-06-11 13:34:40.920
Test Suite 'UITestingUITests' started at 2019-06-11 13:34:40.923
Test Case '-[UITestingUITests testRunner]' started.
    t =     0.00s Start Test at 2019-06-11 13:34:40.927
    t =     0.01s Set Up
  1. 游戏Debug信息也显示Poco启动
Tcp server started and listening at 5002
PocoManager:Awake()

4.建立USB连接proxy 8100 8100

  1. terminal启动AirtestIDE ,连接到ipad

  2. poco unity树无内容,不能展示unity游戏的元素,报错信息见上“描述”

python version: python3.6

poco version: 1.0.69

未查询到poco信息

Smartphone (please complete the following information):

  • Device: ipad mini2
  • OS: ios 10.2
@wodesenlin
Copy link
Author

以上现象之前,连接上ipad就已经出现了另一个问题“BrokenPipeError: [Errno 32] Broken Pipe”
AirtestProject/iOS-Tagent#57

@yimelia
Copy link
Member

yimelia commented Jun 11, 2019

在unity尝试初始化时,会先尝试5001端口,如果失败会往后尝试5002-5004,现在看来是5001被使用了,所以它用了5002端口。
但是在IDE中,由于IOS连接前需要进行端口映射,所以写死了只映射5001端口号,导致没能成功连上你的unity游戏。
你可以先试一下:排查一下你的设备上面5001端口被什么应用占用了,尽量让它空出来给poco使用,然后再连上试试看。

@wodesenlin
Copy link
Author

之前显示5002是我手动将端口改成了5002. 之后修改为5001端口并且外设更换成了ipad Air,能够连接到新的ipad。 连接虽不稳定,但是可以连接。不过在现在的不稳定状态下做测试还是挺不容易的。

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