AirtestProject / AirtestProject/AirtestIDE

在Mac上执行airtest run,没有输出正常结果

Open
#1,040 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
236
Forks
40
PR merge metrics
No merged PRs in 30d

Description

(请尽量按照下面提示内容填写,有助于我们快速定位和解决问题,感谢配合。**否则直接关闭。**)

**(重要!根据问题类型选择分类)**
* 命令行执行脚本问题

**详细描述问题bug:**
bug描述
在Mac上执行airtest run,没有输出正常结果

**复现步骤:**

执行以下命令,只提示运行完成,实际没有执行脚本中的内容。
```bash
~/Source/airtest-ts airtest run "./untitled.air" --device ios:///http+usbmux://00008101-xxxxxxxxxxxxx --log "./00008101-001A11C23C04001E"

save log in './00008101-xxxxxxxxxx'
----------------------------------------------------------------------
Ran 1 test in 0.088s

OK
```
使用IDE提示的命令,可以得到以下截图的结果,运行正常。

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

**操作系统:** `Mac M1`

**手机设备信息:**
- 手机型号:
- iPhone 12

**其他相关信息补充**
(例如在linux ubuntu16.04上运行异常,在windows上正常等信息。)
- AirtestIDE版本号:

**截屏**
强烈建议带上截图,包括IDE本身的截图和后面的黑窗口的报错信息的截图(尽量完整)。
源码:
```python
# -*- encoding=utf8 -*-
__author__ = "sivan"

from airtest.core.api import *

auto_setup(__file__, devices=["ios:///http+usbmux://00008101-xxxxxxx"], logdir=True, project_root=r"./airtest-ts", compress=90)

class StartApp:
def __init__(self):
self.height = G.DEVICE.display_info['width']
self.width = G.DEVICE.display_info['height']
self.min_map_x = 0.9 * self.width
self.min_map_y = 0.1 * self.height

if exists(Template(r"tpl1644501631677.png", record_pos=(0.001, 0.113), resolution=(2532, 1170))):
touch(Template(r"tpl1644501631677.png", record_pos=(0.001, 0.113), resolution=(2532, 1170)))
sleep(3.0)
touch(Template(r"tpl1644501323392.png", record_pos=(0.0, 0.192), resolution=(2532, 1170)))

sleep(5.0)

if exists(Template(r"tpl1644501760230.png", record_pos=(0.308, -0.164), resolution=(2532, 1170))):
touch(Template(r"tpl1644501760230.png", record_pos=(0.308, -0.164), resolution=(2532, 1170)))
else:
self.touch_min_map()
# self.vip4()

def touch_min_map(self):
touch([self.min_map_x, self.min_map_y])
sleep(1)

if __name__ == '__main__':

StartApp()

```

1. 使用 IDE命令执行
image

2. 使用`airtest run`命令执行
image
> 查看log的内容为空。

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.