iOS 设备上不支持逻辑测试?
我正在使用 SenTestingKit 进行单元测试,但收到以下消息
不支持 iOS 设备上的逻辑测试。您可以在模拟器上运行逻辑测试。
我该怎么做?
I am using the SenTestingKit to Unit Test, but I get the following message
Logic Testing on iOS devices is not supported. You can run logic tests on the Simulator.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要有一个主机应用程序
You need to have a Host Application
逻辑测试只能在模拟器上进行,需要切换到模拟器,即
逻辑测试需要特殊的单元测试启动器未安装在实际设备上。
如果您想在实际设备上运行测试,您可以转换为应用程序单元测试。这些本质上是相同的,但是您的应用程序首先启动(作为“主机”),并且您的测试与它们一起运行。这意味着您的测试可以在您的应用程序支持的任何设备上运行。唯一的缺点是您的实际应用程序将运行,这可能会干扰您的测试,特别是如果您使用大量通知。
Logic tests only work on the simulator, you need to switch to the simulator, i.e.
Logic tests require a special unit test launcher which is not installed on actual devices.
If you want to run your tests on an actual device you can convert to application unit tests. These are essentially the same but you application gets launched first (as a 'host') and your tests get run along side them. This means your tests can run on any device that your application supports. The only disadvantage is that your actual app will be running which can interfere with your test, especially if you use a lot of notifications.
我们必须仅通过 webdriverAgrentRunner 在 cxode 中构建和测试我们的项目。选择真实设备:webdriverAgentRuuner>>设备名称
we have to build and test our project in cxode only through webdriverAgrentRunner. select real device : webdriverAgentRuuner>>device name
如果您问自动化测试这个问题,那么“是的,您必须将 WebDriverAgentRunner 更改为真实设备并再次运行测试”。错误将会消失
If you are asking this question for Automation testing then "YES, you have to change the WebDriverAgentRunner to a Real device and run the test again". The error will be disappeared
全龙的回答是正确的,但没有描述细节。以下是在真实设备上测试框架所需的步骤:
单击目标列表下的 + 号并添加“应用程序”类型的目标。 “TestHost”是个好名字。
在测试目标的“常规”选项卡下,添加 TestHost 作为“主机应用程序”
在 TestHost 目标的“常规”选项卡下,将框架本身添加到“框架、库和嵌入内容”列表
如果框架使用 Pod,请编辑 Podfile,添加 < em>target 'TestHost'do 部分并确保所有 pod 也安装到 TestHost 目标中
Quanlong's answer is correct, but it doesn't describe the details. Here are the needed steps in order to test a framework on a real device:
Click the + sign under the list of targets and add a target of type "Application". "TestHost" is a good name.
Under the General tab of the Tests target, add TestHost as the "Host Application"
Under the "General" tab of the TestHost target, add the framework itself to the list of "Frameworks, Libraries and Embedded Content"
If the framework uses Pods, edit the Podfile, add a target ‘TestHost’ do section and make sure all pods are also installed into the TestHost target