It is possible to prevent Xcode from calling the debugger after calling `XCUIApplication (). Terminate () `

I am using UITest to test a C object application, using quick for tests.

Xcode 7.3, sim 9.3

Each test case calls XCUIApplication.launch (), which kills any running application by sending SIGKILL.

Xcode treats this as a failure - invoking a debugger on main.m To continue working with the test package, just click the "Continue" button in the debugger.

After continuing, my journal says:

 Message from debugger: Terminated due to signal 9 

This situation is frustrating because it happens after 1/4 of my test cases. Due to the fact that I lost focus on the document, which I edit and call, so that my test suite hangs until I hit.

Is there any way around this?

+5
source share
2 answers

We faced the same problem. After some debugging, we found out that this was due to the fact that Background Modes enabled for your application.

Our solution was to create a new development and testing goal that turned off all Background Modes .

FYI, in the Capabilities section of your project’s parameters, labeled Background Modes , turns this key Off . Alternatively, you can remove the Require background modes key (aka UIBackgroundModes ) from Info.plist

+4
source

You can go for debugging and / or testing after completion with xCode. On the menu:

  • Debug
  • Attach to process
  • Choose Likely Targets or By Process Identifier (PID)
0
source

Source: https://habr.com/ru/post/1246424/


All Articles