iOS:如何在设备上运行 XCTest? [英] iOS: how to run XCTest on device?

查看:35
本文介绍了iOS:如何在设备上运行 XCTest?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在学习 XCTest 以进行单元测试.我能够在模拟器上运行默认模板 XCtest 没有任何问题.我可以在测试导航视图中显示所有绿色勾号.但是,当我使用我的应用程序作为主机应用程序在设备上运行它们时,没有任何反应.我的应用程序在设备上启动,但 XCTest 似乎没有运行.我什至在测试中设置了一个断点,它没有中断.此外,在模拟器中,应用程序在测试完成后会自动停止,但是,在设备上运行时,我的应用程序一直在运行,从未停止.我做错了什么吗?

I currently learning XCTest for the purpose of unit testing. I was able to run the default template XCtest on the simulator without any problem. I could all the green ticks in the test navigation view. However, when I ran them on the device with my app as host application, nothing happens. My app was launched on the device and the XCTest did not seem to run. I even put a break point in the test and it did not break. Also, in the simulator, the app automatically stops when tests finish, however, when running on device, my app was just kept running and never put to a stop. Am I doing something incorrect?

推荐答案

在物理设备上运行 XCTest 时,xCode 应显示此消息.

xCode should show this message when running XCTest on a physical device.

不支持在 iOS 设备上进行逻辑测试.您可以在模拟器上运行逻辑测试.

Logic Testing on iOS devices is not supported. You can run logic tests on the Simulator.

这篇关于iOS:如何在设备上运行 XCTest?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆