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.

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
Xcode 14.3.1 get the same issue, What works for me is
Test Plan -> Edit Test Plan

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

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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With