alibaba / alibaba/tidevice

ios下tidevice打开多个app后会报错, 重启后才能恢复

Open
#243 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
2.6k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

我的测试任务需要按照顺序打开和关闭200个app

在ios上使用airtest的start_app()会报错, 改为直接用subprocess调用"tidevice lauch ***", 大约跑了几十个app后就会报以下错误, 只有重启iphone后才能再打开app

```python
def start_app(self, package):
if self.plat == "android":
self.device.start_app(package=package)
else:
subprocess.check_output(f"tidevice launch {package}", shell=True)

def stop_app(self, package):
if self.plat == "android":
self.device.stop_app(package=package)
else:
subprocess.check_output(f"tidevice kill {package}", shell=True)
```

```python
start app_id: 203, name: 海底捞, deviceName: Jicheng的iPhonese2
Traceback (most recent call last):
File "/Users/liuf/opt/anaconda3/bin/tidevice", line 8, in
sys.exit(main())
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/__main__.py", line 951, in main
actions[args.subparser](args)
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/__main__.py", line 362, in cmd_kill
pid = d.app_kill(args.name)
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_device.py", line 690, in app_kill
return self.app_stop(*args, **kwargs)
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_device.py", line 682, in app_stop
for p in ps:
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_instruments.py", line 737, in app_process_list
processes = self.app_running_processes()
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_instruments.py", line 708, in app_running_processes
retobj = self.call_message(identifier, "runningProcesses")
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_instruments.py", line 357, in call_message
channel = self.make_channel(channel)
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_instruments.py", line 318, in make_channel
result = self.call_message(0, '_requestChannelWithCode:identifier:', aux)
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_instruments.py", line 359, in call_message
_id = self.send_dtx_message(channel,
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_instruments.py", line 398, in send_dtx_message
self.psock.sendall(data)
File "/Users/liuf/opt/anaconda3/lib/python3.9/site-packages/tidevice/_safe_socket.py", line 118, in sendall
return self._sock.sendall(data)
File "/Users/liuf/opt/anaconda3/lib/python3.9/ssl.py", line 1204, in sendall
v = self.send(byte_view[count:])
File "/Users/liuf/opt/anaconda3/lib/python3.9/ssl.py", line 1173, in send
return self._sslobj.write(data)
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:2483)
```

系统信息
macOS 12.5
iphone 15.6
python 3.9
tidevice 0.9.7

设备
iPhone SE (2nd generation)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the sequential launch and kill workflow with the listed macOS, iPhone, Python, and tidevice versions, then trace the TLS EOF through tidevice/__main__.py, tidevice/_device.py, tidevice/_instruments.py, and tidevice/_safe_socket.py. Determine why repeated app operations leave the device unusable until reboot; done means the 200-app sequence no longer reaches this failure or requires a device restart.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.