I started to see this issue right after upgrading to Apple M1.
xctest encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/nalex/Library/Developer/Xcode/DerivedData/App-aneasilnxtjatpdadaucmmgyspqa/Logs/Test/Run-LibName-Unit-Tests-2021.02.20_17-38-24-+0300.xcresult. (Underlying Error: Invalid device state))
In my case, this is the output of the pod lib lint running unit tests from the command line on my machine. The same tests run OK from Xcode.