Xcode - unit-tests: Test session exited(-1) without checking in

淺唱寂寞╮ 提交于 2019-12-08 16:54:24

问题


I have serious trouble with unit-tests in XCode. I use XCode 6.4 Build version 6E35b on OS X Yosemite and OS X Capitan.

As a result I have such an error:

_finishWithError:Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Test session exited(-1) without checking in." UserInfo=0x7fbfea2b60b0 {NSLocalizedDescription=Test session exited(-1) without checking in.} didCancel: 1

There are already some posts on stack (for instance, Xcode Server CI Bot Test Session exited(-1)), but solution was not found.

I tried to run unit-tests from XCode and from command-line, but too often I had that error. In last case I did 3 steps:

1. Deleting everything from DERIVED_DATA_PATH
2. Installing pods
3. Ran unit-tests with command: xcodebuild test -scheme UnitTests -destination 'platform=iOS Simulator,name=iPhone 5s,OS=8.2' -derivedDataPath 'temp-build-dir' 2>&1

It is a great trouble for me, because I use these tests in common automatic build flow with UI-tests and if they fail, the whole flow fails.

In release notes for XCode 6 there was information from Apple about that bug, and their workaround was to simply rerun tests. It is unacceptable for me, because they run automatically with other tests and it seems to be bad idea to rerun them until they pass or simply run without that error.


回答1:


Possible solution

Launch this command in the terminal

sudo /usr/sbin/DevToolsSecurity --enable

What is probably causing the problem

If you launched the tests not on a headless terminal you would see this dialog:



来源:https://stackoverflow.com/questions/31475102/xcode-unit-tests-test-session-exited-1-without-checking-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!