Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

Xcode Error Alert 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.

like image 320
Mark Bridges Avatar asked Sep 24 '19 11:09

Mark Bridges


2 Answers

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.

like image 189
Duke peng Avatar answered Oct 31 '22 16:10

Duke peng


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:

enter image description here

I had to change to:

enter image description here

like image 6
Chris Livdahl Avatar answered Oct 31 '22 14:10

Chris Livdahl