0

I have a strange issue in which a unit test fails only when running tests through the CLI:

xcodebuild test -project project.xcodeproj -scheme project -destination 'platform=iOS Simulator,name=iPhone 8,OS=15.5'

And it fails with:

Fatal error: Attempted to read an unowned reference but object 0x6000036fe610 was already deallocated

Sadly I am using a lot of unowned in my code and the test passes when I run it in the GUI (Xcode).

I am wondering if it is possible to get a stacktrace along with the error, because I do not know where to start now. It just says 'Fatal error' without any helpful line number. I won't just change unowned to weak to make the test pass.

How can I make sure the xcodebuild also provides a stacktrace when an error occurs?

J. Doe
  • 12,159
  • 9
  • 60
  • 114
  • Does this answer your question? [Xcode stack trace not appearing in console](https://stackoverflow.com/questions/7960816/xcode-stack-trace-not-appearing-in-console) – lazarevzubov Jun 12 '22 at 10:16
  • @lazarevzubov unfortunately not :( that is about the gui, not cli – J. Doe Jun 12 '22 at 11:09

0 Answers0