Search code examples
xcodeunit-testingxctest

Error: The test runner exited with code -1 before checking in


After build finishes without issue, running Xcode 12.4 project's tests fail with message:

MyProject.app (10164) encountered an error (
  Early unexpected exit,
  operation never finished bootstrapping - no restart will be attempted. (
    Underlying Error: The test runner exited with code -1 before checking in.
    If you believe this error represents a bug,
    please attach the result bundle at /Users/admin/Library/Developer/Xcode/DerivedData/MyApp-gczfeuobxydqjrfbdhwzpqjsseyr/Logs/Test/Test-MyApp-2021.09.29_23-12-38-+0430.xcresult
  )
)

What is above message trying to mean?!
(parenthesis spacing is by me, to make human-readable)

About My System: macOS Catalina version 10.15.7 (19H2)
MacBook Pro (13-inch, Mid 2010)
Processor 2.4 GHz Intel Core 2 Duo
Memory 4 GB 1067 MHz DDR3
Graphics NVIDIA GeForce 320M 256 MB


Solution

  • TK;DR; Either update MacOS to latest, or downgrade Xcode to 11.7 version.


    At last I found reason, seems Xcode 11.7 (or rather it's SDK), is the last version which supports running on Catalina version of MacOS
    (without any manual extra effort).

    But running tests for iOS device works (without macOS update).

    Someone please tell Apple to improve their error messages :-(