在Xcode 6和设备上运行测试 [英] Running tests on Xcode 6 and device

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

问题描述

我正在尝试在Xcode 6
上运行单元测试,如果我在模拟器上运行它们(和7.1那样)它们运行良好

I am trying to run unit tests on Xcode 6 if I run them on the simulator (and 7.1 at that) they run fine

其他条件收到此消息:

2014-10-10 01:39:56.190 MyApp[493:173988] Error loading    
/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605- 
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests:  
dlopen(/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605-
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests, 262): no suitable image found.  
    Did find:

/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605-
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests: mmap() error 1 at address=0x006D0000, 
size=0x0001E000 segment=__TEXT in Segment::map() mapping
/private/var/mobile/Containers/Data/Application/A6C42E86-0147-4447-A605-
FF864C5BD0F7/tmp/MyAppTests.xctest/MyAppTests

我该如何修复它?

推荐答案

您必须首先确保测试目标中的调试符号设置如下:

You have to first make sure your debug symbols in the test target are setup like this:

然后确保您的测试目标
构建阶段的编译源中没有任何类,这些类不是测试
并且您的应用程序的目标是构建中的目标依赖项测试目标的阶段

Then make sure you don't have any classes in the compile sources of your test target build phase that are not tests and that you have your app's target as a target dependency in the build phases of the test target

然后在测试目标的常规选项卡中确保测试应用程序已设置,并且允许测试主机应用程序API中有一个复选标记

Then in the general tab of your test target make sure the test application is set, and there is a checkmark in allow testing host application API

最后但并非最不重要的是,你必须确保运行测试的设备没有运行iOS 8.0(是8点零),
7.1.2都不错或者8.1 - 如果您的xcode不支持8.1,您必须下载此支持 - 它已经通过xcode偏好设置的下载部分提供。

last but not least, you have to make sure that the device you are running your test on, is not running iOS 8.0 (yes eight dot zero), either 7.1.2 are good or 8.1 - if your xcode does not support 8.1 you have to download this support - it's already available through the download section in the xcode preferences.

这篇关于在Xcode 6和设备上运行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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