Unable To Run Unit Tests in Xcode 11: The run destination * is not valid for tests you have chosen to perform

主宰稳场 提交于 2019-12-01 15:06:15

问题


Pretty sure my tests were running fine before I updated from Xcode 10.3 to Xcode 11. Now when I try to run a test I get the following error.

The run destination iPhone 5s is not valid for tests you have chosen to perform. Please select a run destination which supports the tests that you wish to perform.

As an experiment, I tried creating a brand new test target and running the example tests that it gives you and the error is the same. I've also tried with different simulators.


回答1:


Check your Targets: (test Target) -> Build Settings -> Deployment -> iOS
Deployment Target: select a lower iOS version eg: iOS 10.0

This will be solving your problem.




回答2:


Try out different simulators,

for me it solved by switching to my connected Device, run the test, than switch back to simulator.




回答3:


For me, my Targeted Device Family in the Build Settings for my test target, was iPad-only, whereas the Targeted Device Family was Universal for the app target.

I had to change the Targeted Device Family to Universal for my test target to match the Targeted Device Family for the app.

It was:

I had to change to:



来源:https://stackoverflow.com/questions/58078991/unable-to-run-unit-tests-in-xcode-11-the-run-destination-is-not-valid-for-tes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!