Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode hanging unit tests

My unit tests for iOS app are hanging in the launching state. It is the same regardless launching on simulator or actual device. It looks like the test is launched and then app is stuck at the launch image forever without any sign of activity. Xcode shows testing but nothing happens

Sometimes when I kill Xcode, the first unit test runs after re-launch OK but then it is the same story hanging all other tests :(

using Xcode 13.2.1

like image 321
Pavel Zak Avatar asked May 24 '26 18:05

Pavel Zak


2 Answers

Xcode 14.3.1 get the same issue, What works for me is

Test Plan -> Edit Test Plan

enter image description here

and in Options untick "Execute in parallel (if possible)"

enter image description here

like image 54
UdayaLakmal Avatar answered May 27 '26 18:05

UdayaLakmal


Before running your tests, try first deleting the app from your device. Then from the Xcode menu do Product -> Clean Build Folder, Product -> Clean Test Results, Product -> Build. Next, change your Scheme to a Test Scheme. Now you can click on the Test Navigator Icon (top left diamond shape icon). And you can select the tests to run by clicking on the diamond icons next to each test, or by clicking the top-level one that runs all tests.

like image 43
Lee Hounshell Avatar answered May 27 '26 18:05

Lee Hounshell