AirtestProject / AirtestProject/Poco

Mac连接Android手机,使用airtest命令跑脚本,无法正确结束,一直停留在orientationWatcher has ended

Đang mở
#144 8 bình luận 0 reaction 1 người được giao Được @yimelia nhận Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
2k
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**描述问题bug**
Mac连接Android手机,使用airtest命令跑脚本,命令无法正确结束,一直停留在orientationWatcher has ended
脚本应该是没问题的,同样的脚本,同样的手机,在windows上使用airtest命令是没问题的。
经过排查,发现只要初始化了poco就会引发此问题,不使用poco,命令可以正常结束。

```
/usr/local/lib/python3.7/site-packages/airtest/aircv/utils.py:51: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
nparr = np.fromstring(pngstr, np.uint8)
======================================================================
ERROR: runTest (airtest.cli.runner.AirtestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/airtest/cli/runner.py", line 61, in runTest
exec(compile(code.encode("utf-8"), pyfilepath, 'exec'), self.scope)
File "/Users/ziroom/android/workspace/jenkins/workspace/Air_Test/logout.air/logout.py", line 16, in
cExit()
File "common.air/common.py", line 48, in cExit
sys.exit(0)
SystemExit: 0

----------------------------------------------------------------------
Ran 1 test in 68.981s

FAILED (errors=1)
[05:57:07][DEBUG] /usr/local/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s 85GABMDV5ANR forward --remove tcp:12774
[05:57:07][DEBUG] /usr/local/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s 85GABMDV5ANR forward --remove tcp:13748
[05:57:07][DEBUG] /usr/local/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s 85GABMDV5ANR forward --remove tcp:13789
[05:57:07][DEBUG] /usr/local/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s 85GABMDV5ANR forward --remove tcp:13407
[05:57:07][DEBUG] orientationWatcher has ended
```

**复现步骤**
1. 脚本添加poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
2. airtest运行此脚本
3. airtest命令无法结束

**预期效果**
希望airtest命令可以结束

**相关截图**

**python 版本:** `python3.7.2`

**poco 版本:** `1.0.75`
**airtest 版本:** `1.0.26`

**设备:**
- 型号: [e.g. 魅族mx5]
- 系统: [e.g. Android 5.1]

**其他相关环境信息**
在mac osx上运行异常,在windows上正常。

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.