alibaba / alibaba/tidevice

非首次启动wda,概率性启动失败

Open
#160 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.6k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

tidevice:0.5.3
device:iPhone 7 11.4.1

安装后首次启动 wda 都可以正常启动,执行自动化脚本后 kill 相关进程,再次启动 wda 执行下一条 case 时,报错启动失败。
同样的环境,另外一台 iPhone 7 13.3.1 不会出现该问题。

启动命令:
```
tidevice -u 02a6a07b3460d6529028bd396f190475ae63762b wdaproxy -B com.facebook.WebDriverAgentRunner.xctrunner --port 8904
```

tidevice 输出日志:
```
[I 211116 19:42:57 _wdaproxy:125] [device_id] WDA check every 30.0 seconds
[D 211116 19:42:57 _wdaproxy:131] [device_id] launch WDA
[I 211116 19:42:58 _device:958] BundleID: com.facebook.WebDriverAgentRunner.xctrunner
[I 211116 19:42:58 _device:961] ProductVersion: 11.4.1
[I 211116 19:42:58 _device:963] DeviceIdentifier: device_id
[I 211116 19:42:58 _device:802] SignIdentity: 'sign_info'
[I 211116 19:42:58 _device:808] CFBundleExecutable: WebDriverAgentRunner-Runner
[I 211116 19:42:58 _device:839] AppContainer: /private/var/mobile/Containers/Data/Application/FDACF76D-2EB6-48F1-9FFB-084AA045E7C0
[I 211116 19:42:58 _device:879] Launch 'com.facebook.WebDriverAgentRunner.xctrunner' pid: 3398
[I 211116 19:42:58 _device:1012] Test runner ready detected
[I 211116 19:42:58 _device:1005] Start execute test plan with IDE version: 29
[I 211116 19:42:58 _device:1084] xctrunner quited
[E 211116 19:42:59 _wdaproxy:150] [device_id] wda started failed
[D 211116 19:42:59 _wdaproxy:131] [device_id] launch WDA
[I 211116 19:43:00 _device:958] BundleID: com.facebook.WebDriverAgentRunner.xctrunner
[I 211116 19:43:00 _device:961] ProductVersion: 11.4.1
[I 211116 19:43:00 _device:963] DeviceIdentifier: device_id
[I 211116 19:43:00 _device:802] SignIdentity: 'sign_info'
[I 211116 19:43:00 _device:808] CFBundleExecutable: WebDriverAgentRunner-Runner
[I 211116 19:43:00 _device:839] AppContainer: /private/var/mobile/Containers/Data/Application/FDACF76D-2EB6-48F1-9FFB-084AA045E7C0
[I 211116 19:43:00 _device:879] Launch 'com.facebook.WebDriverAgentRunner.xctrunner' pid: 3402
[I 211116 19:43:00 _device:1012] Test runner ready detected
[I 211116 19:43:00 _device:1005] Start execute test plan with IDE version: 29
[I 211116 19:43:00 _device:1084] xctrunner quited
[E 211116 19:43:01 _wdaproxy:150] [device_id] wda started failed
[D 211116 19:43:01 _wdaproxy:131] [device_id] launch WDA
[I 211116 19:43:02 _device:958] BundleID: com.facebook.WebDriverAgentRunner.xctrunner
[I 211116 19:43:02 _device:961] ProductVersion: 11.4.1
[I 211116 19:43:02 _device:963] DeviceIdentifier: device_id
[I 211116 19:43:02 _device:802] SignIdentity: 'sign_info'
[I 211116 19:43:02 _device:808] CFBundleExecutable: WebDriverAgentRunner-Runner
[I 211116 19:43:02 _device:839] AppContainer: /private/var/mobile/Containers/Data/Application/FDACF76D-2EB6-48F1-9FFB-084AA045E7C0
[I 211116 19:43:02 _device:879] Launch 'com.facebook.WebDriverAgentRunner.xctrunner' pid: 3406
[I 211116 19:43:02 _device:1012] Test runner ready detected
[I 211116 19:43:02 _device:1005] Start execute test plan with IDE version: 29
[I 211116 19:43:02 _device:1084] xctrunner quited
[E 211116 19:43:03 _wdaproxy:150] [device_id] wda started failed
[D 211116 19:43:03 _wdaproxy:131] [device_id] launch WDA
[I 211116 19:43:04 _device:958] BundleID: com.facebook.WebDriverAgentRunner.xctrunner
[I 211116 19:43:04 _device:961] ProductVersion: 11.4.1
[I 211116 19:43:04 _device:963] DeviceIdentifier: device_id
[I 211116 19:43:04 _device:802] SignIdentity: 'sign_info'
[I 211116 19:43:04 _device:808] CFBundleExecutable: WebDriverAgentRunner-Runner
[I 211116 19:43:04 _device:839] AppContainer: /private/var/mobile/Containers/Data/Application/FDACF76D-2EB6-48F1-9FFB-084AA045E7C0
[I 211116 19:43:04 _device:879] Launch 'com.facebook.WebDriverAgentRunner.xctrunner' pid: 3411
[I 211116 19:43:04 _device:1012] Test runner ready detected
[I 211116 19:43:04 _device:1005] Start execute test plan with IDE version: 29
[I 211116 19:43:04 _device:1084] xctrunner quited
[E 211116 19:43:05 _wdaproxy:150] [device_id] wda started failed
[D 211116 19:43:05 _wdaproxy:131] [device_id] launch WDA
[I 211116 19:43:06 _device:958] BundleID: com.facebook.WebDriverAgentRunner.xctrunner
[I 211116 19:43:06 _device:961] ProductVersion: 11.4.1
[I 211116 19:43:06 _device:963] DeviceIdentifier: device_id
[I 211116 19:43:06 _device:802] SignIdentity: 'sign_info'
[I 211116 19:43:06 _device:808] CFBundleExecutable: WebDriverAgentRunner-Runner
[I 211116 19:43:06 _device:839] AppContainer: /private/var/mobile/Containers/Data/Application/FDACF76D-2EB6-48F1-9FFB-084AA045E7C0
[I 211116 19:43:06 _device:879] Launch 'com.facebook.WebDriverAgentRunner.xctrunner' pid: 3415
[I 211116 19:43:07 _device:1012] Test runner ready detected
[I 211116 19:43:07 _device:1005] Start execute test plan with IDE version: 29
Exception in thread Thread-2:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tidevice/_instruments.py", line 560, in _drain
self._drain_single_message()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tidevice/_instruments.py", line 611, in _drain_single_message
self._reply_null(dtxm)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tidevice/_instruments.py", line 518, in _reply_null
message_id=m.message_id)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tidevice/_instruments.py", line 392, in send_dtx_message
self.sendall(data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tidevice/_safe_socket.py", line 66, in sendall
return self._sock.sendall(data)
BrokenPipeError: [Errno 32] Broken pipe

[I 211116 19:43:07 _device:1084] xctrunner quited
[E 211116 19:43:07 _wdaproxy:150] [device_id] wda started failed
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the repeated `tidevice ... wdaproxy` launch on the listed iPhone 7 and iOS 11.4.1 setup. Read the `_wdaproxy` flow and the referenced `_instruments.py` and `_safe_socket.py` paths, focusing on the xctrunner exit and BrokenPipeError. Done means WDA can be relaunched after the prior process is killed without repeated startup failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, python
Domain
mobile-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.