简体   繁体   English

Xcode 7.2:无法在iPhone 6s上运行单元测试

[英]Xcode 7.2: Impossible to run unit tests on iPhone 6s

I have a complex enough application with some tests which as far as I remember used to run and give output whether they were successful or not. 我有一个足够复杂的应用程序,其中包含一些测试,据我所记得,它们曾经运行过并给出输出,无论它们是否成功。

I did not run the tests every time I changed the code (not very proud of it) but now after some months after the last test run, I cannot seem to run the tests on device. 我每次更改代码时都没有运行测试(不是很自豪),但是现在在上次测试运行几个月后,我似乎无法在设备上运行测试。 Xcode has been updated at least 2 times since then. 从那时起,Xcode已至少更新了2次。

Before giving you the 3 different errors I get each time I run the tests (yes, it is that bad), I have to mention that I get nearly the same behavior with a fresh, minimal test app I created to see what is going on. 在为您提供每次运行测试时都会遇到的3种不同的错误(是的,这很糟糕)之前,我必须提到,使用我创建的用于查看运行情况的最小的最新测试应用程序,我得到的行为几乎相同。 The tests I run in that case are also minimal, like: 我在那种情况下运行的测试也很少,例如:

assetEqualsObjects(@"a", @"b").

Every time I run the test, I get no output apart from the "success" or "failed" icon, which is not consistent at all, as it passes or fail the same test depending on its whims. 每次运行测试时,除了“成功”或“失败”图标外,没有任何输出,这完全不一致,因为它会根据异想天开通过或通过相同的测试。

"sometimes" i get this popup error: “有时”我收到此弹出错误:

The run destination .... is not valid for Testing the scheme 'TestApplication'. 运行目的地..对于测试方案“ TestApplication”无效。

"some other times" i get the following popup: “其他时候”我得到以下弹出窗口:

process launch failed: timed out trying to launch app 进程启动失败:尝试启动应用程序超时

and finally, sometimes I get an error in the main loop in this line: 最后,有时我在这一行的主循环中遇到错误:

 return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

I would go deeper to my app and see what I m doing wrong, but I luckily created a minimal app and i get the same behavior. 我会更深入地研究我的应用程序,看看我做错了什么,但是幸运的是,我创建了一个最小的应用程序,并且得到了相同的行为。

i would like that someone if not give a solution, at least try to help to isolate the error... 我希望有人能够提供解决方案,至少要设法帮助隔离错误...

UPDATE: my primary development device is an iPhone 6s, but I tried to reproduce the problem on an iPhone 6 and and could not, everything works as it should. 更新:我的主要开发设备是iPhone 6s,但是我试图在iPhone 6上重现该问题,但不能,一切正常。 So the problem may be at the phone... 所以问题可能出在电话上...

So, the problem appears to be solved after rebooting the device. 因此,重新启动设备后,该问题似乎已解决。 When the problem first arose, I rebooted the Mac and Xcode but this did not help, so my guess was that it was not deterministic. 当问题首次出现时,我重新启动了Mac和Xcode,但这并没有帮助,所以我猜测这不是确定性的。 I was proved wrong... 我被证明是错的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM